System Design
Aug 30, 20269 min read
Designing a Distributed Rate Limiter: Token Bucket, Sliding Window, and the Redis Trade-off Nobody Mentions
Rate limiting looks like a one-line INCR in a whiteboard interview and turns into a race-condition minefield the moment it's distributed across nodes. A tour of the four real algorithms, and the atomicity bug that ships in more Redis rate limiters than anyone admits.