Backend Engineering
|
banditz
How to Implement API Rate Limiting — Token Bucket, Sliding Window, and the Edge Cases Nobody Warns You About
Your API has no rate limiting and someone just hit it 50,000 times in a minute. Here's how to pick the right algorithm, implement it with Redis, and handle the edge cases that break naive implementations.