
System Design
Designing a Rate Limiter: Token Bucket, Sliding Window and Redis
A practical design guide to rate limiting: fixed window, sliding log, sliding window counter and token bucket compared, with atomic Redis Lua implementations, a TypeScript middleware, response headers, failure modes and the trade-offs that matter in distributed systems.
Sep 11, 2026 · 10 min read