Design a Distributed Rate Limiter
Problem Design a distributed rate limiter using a sliding-window approach that scales to millions of requests/sec with fairness across clients.
Functional requirements
- Per-client request limits.
- Sliding-window accuracy.
- Fairness across many clients.
- Low added latency on the request path.
Non-functional requirements
- Millions of req/sec across many nodes.
- Tolerate node failures and clock skew.
- Absorb bursts gracefully.
Areas to go deep
- Sliding-window log vs counter trade-offs.
- Distributed state (Redis / consistent hashing) and where the counter lives.
- Fairness, burst absorption, network latency, and clock-skew handling.
- Failure modes and graceful degradation.
added …