Cap the firehose before it floods the basement.
Rate Limiting: cap the firehose before it floods the basement
turn boundaries into contracts
Strict global limits hurt legitimate bursts.
Rate limits keep abusive or buggy clients from harming everyone else. The common algorithms are token bucket (burst + steady refill), leaky bucket (constant rate), and window-based counters.
Token bucket: B tokens cap, R refill/sec; fits APIs that allow short bursts.
Sliding window: smooth, more accurate than fixed-window.
Communicate: 429 Too Many Requests + X-RateLimit-Remaining + Retry-After.
Public API with per-key 100 req/min limit.