Quick Decision Rule: When Enforcing a strict 100 req/min API quota so a bursty client cannot push 200 requests through in 2 seconds across a minute boundary, choose Token Bucket or Sliding Window Log/Counter.
| Trigger Condition | Enforcing a strict 100 req/min API quota so a bursty client cannot push 200 requests through in 2 seconds across a minute boundary |
|---|---|
| Recommended Choice | Token Bucket or Sliding Window Log/Counter |
| Classic Trap | Fixed-window counters allow 2x traffic bursts at window boundaries (100 requests at 00:59 + 100 requests at 01:00). |
| Verification | Audited on 2026-11-23 · Distributed Systems Core · 2026 |
30-SECOND DECISION TRAP CHECK · RELIABILITY
Your API gateway enforces 100 req/min using a fixed-window Redis counter (`INCR user:HH:MM`). An automated scraper fires 100 requests at 12:00:59 and 100 more at 12:01:00—pushing 200 requests in 2 seconds and overloading downstream workers. Which algorithm prevents this boundary burst?
Fixed-window counters allow 2x the quota across window edges. Sliding window counters and Token Buckets smooth burst traffic across arbitrary time boundaries.
Trap: Fixed-window rate limiters suffer from 2x boundary spikes; use Sliding Window or Token Bucket.