How do I build a rate limiter with Redis?
Fixed window, sliding log, sliding window counter and token bucket: how each works in Redis, where it goes wrong, and how to keep it atomic and cluster-safe.
In this article
- 01Pattern 1: fixed window counter
- 02Pattern 2: sliding window log
- 03Pattern 3: sliding window counter (a good default)
- 04Pattern 4: token bucket (allows controlled bursts)
· 8 min read
