bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/System Design/Design a Rate Limiter
System Design•Design a Rate Limiter

Design a Rate Limiter: Capacity Estimation

Design a distributed rate limiter that caps how many requests a client (API key / IP) can make per time window.

How to approach it

Capacity estimation converts product numbers into engineering pressure. Go from daily active users to queries-per-second (QPS ≈ DAU × actions ÷ 86,400, with a 2–3× peak), then to storage (writes/day × payload × retention) and bandwidth (QPS × response size). You only need the order of magnitude — it tells you whether to design for read scaling, write scaling, or storage first.

Assumptions

AssumptionValue
Total QPS1M/s
Distinct clients10M
Window1 minute
Counter size~16 B/client

Derived numbers

QuantityEstimate
Limiter checks/s1M (one per request)
Counter memory~160 MB
Store latency budget< 1ms
Hotspot riskpopular keys

Note

Every request hits the limiter, so the counter store must be in-memory and sub-millisecond.

Previous

Design a Rate Limiter: Requirements & Scope

Next

Design a Rate Limiter: API & Data Model