Design a Quota / Rate-Limiting Service
Problem
Design a distributed quota/rate-limiting service for a data platform (Snowflake-style design, not a generic web app).
Requirements
Functional:
- Enforce per-account compute/query quotas
- Distributed sliding-window rate limiting
- Fair sharing across clients
- Real-time quota reads
Non-functional:
- Millions of requests/sec
- Accurate under bursts
- Low added latency
Discussion points
- Sliding-window vs token-bucket at scale
- Distributed counters (Redis) and consistency
- Fairness and burst handling
- Fault tolerance and clock skew
- Hot-account mitigation
added …