Loading lesson…
Level 1 · Apprentice0 XP
Protect a system from too many requests, whether from a bug, a crawler or an attack.
Step 1 / 5
ProblemA partner's script has a bug and calls your API 5,000 times a second. Every other customer gets timeouts.
← → step
Before this: Content delivery networks
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Implement a per-user token bucket in Redis with a Lua script (or a library such as Bucket4j), and return 429 with Retry-After from a Spring or Express endpoint.