Fixed Window
ELI5 — The Vibe Check
Fixed window rate limiting counts requests in fixed time blocks (e.g., per minute). Simple: reset the counter every 60 seconds. The catch? A user can send 100 requests at second 59 and 100 more at second 61 — 200 requests in 2 seconds while technically respecting the 100/minute limit.
Real Talk
The fixed window algorithm divides time into fixed intervals and counts requests per window. When a window expires, the counter resets. It's simple and memory-efficient (one counter per key per window) but vulnerable to burst traffic at window boundaries. A user can theoretically send 2x the limit across a boundary. Often used where simplicity outweighs precision.
When You'll Hear This
"Fixed window rate limiting is simple but has the boundary burst problem." / "Start with fixed window — upgrade to sliding window if the boundary exploit matters."
Related Terms
Leaky Bucket
A leaky bucket processes requests at a fixed rate, like water dripping from a bucket. No matter how fast requests pour in, they come out at a steady drip.
Rate Limiting
Rate limiting is like a bouncer who says 'you can come in 100 times per hour, then you wait.
Sliding Window
Sliding window rate limiting counts requests in a moving time window.
Token Bucket
A token bucket is a rate limiting algorithm. Imagine a bucket that fills with tokens at a steady rate. Each request costs one token.