Lesson 11 of 15
32. Design a Rate Limiter as a Service

32.10 What would you say in the last five minutes?

3 min read+10 XP

Step 6: Wrap-up (5 minutes)

  • Bottleneck: Redis operations. Covered by sharding, one script per check, and local token batches for giant tenants.
  • Single points of failure: Redis shards (replicas, plus fail-open with local backstops); the rules service (clients keep the last good rules in memory, so it can be down without affecting checks).
  • Safety: rule changes are versioned, validated (no "limit 0 for everyone" by typo), rolled out gradually, and instantly reversible. A bad rule is the most likely way this service hurts the company.
  • Visibility: per-rule dashboards of allowed vs limited, top limited keys, and alerts when a rule starts limiting far more than usual.
  • Next with more time: cost-based limits for GraphQL, concurrency limits (in-flight requests rather than rate), self-serve rule testing ("what would this rule have blocked yesterday?").

Memory code: "The limiter must never be the outage."