Prefab Cloud Safety/Durability Levels

Prefab rate limiters currently come in two levels.

Each limit definition that you create can be created at any durability level.

L4_BEST_EFFORT [Default]

  • Prefab.cloud provided
  • Prefab.cloud coordinated limit definitions edit limit definitions in our UI
  • Small likelihood of lost limit tracking in failure scenarios
  • Cheaper than level-5

L5_BOMBPROOF

  • Prefab.cloud provided
  • All reads and writes hit the backing store which replicates data across three facilities in an AWS Region to provide fault tolerance in the event of a server failure or Availability Zone outage.
  • 3 year Persistent
client = Prefab::Client.new
ratelimit_client = client.ratelimit_client

# override default safety_level to bombproof
ratelimit_client.upsert("grp",
                        :MINUTELY_ROLLING,
                        60,
                        safety_level: Prefab::LimitDefinition::SafetyLevel::L5_BOMBPROOF)

# use limit as normal
if ratelimit_client.pass?("grp")
  do_the_action()
end
safety level 4

Prefab API will use our internal Redis cache with safety level 4.

safety level 5

Prefab API skips Redis cache and uses DynamoDB directly in Strongly Consistent mode with safety level 5.