Why you shouldn’t use Redis as a rate limiter: Part 1 of 2
A tour of the common Redis-based rate limiter implementations — and the correctness and performance traps each one hides.
We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Rate limiting and admission checks that help reduce overload and protect expensive work.
Set admission budgets for launch spikes and promos before excess work reaches your handlers.
Fewer moving parts to run and monitor. Spend less on Redis and ops.
Add via SDK. Keep your stack. Clear limits your customers understand.
UNDERSTAND OVERLOAD · KEEP USEFUL WORK MOVING
For developers, architects, and managers: 27 narrated lessons on why services overload and how to protect them. No cloud experience required. Start with one request, or jump to any lesson.
Four chapters, one learning path. Read or listen in any order. ~41 minutes total · Times shown at 1×.
Keep enough capacity to finish work and recover.
Contain one customer's excess without punishing everyone.
Reduce work entering a shared dependency when it slows.
Choose, combine, and test the right protections.
Read the explanation or use the course map above. Audio is optional.
Recovery state machine
Caller needs an answer
Separate dependency
Suggestions are optional
Illustrative mechanism. Highlight follows the explanation; not a benchmark.
Read the numbered steps in order. The explanation below follows the narration.
A recommendations dependency can fail while the application still works.
Closed permits calls; open refuses them; half-open tests recovery with bounded probes.
Closed permits calls; open refuses them; half-open tests recovery with bounded probes.
Imagine a video website asking another service for suggested videos. That service is a dependency. If its calls repeatedly fail, a circuit breaker can stop the application from making more of those calls.
Closed means calls are permitted. In a simple example, three observed failures within sixty seconds open the breaker. Open means calls are rejected locally, without waiting for the remote answer. The application can show a precomputed list of this week's releases instead.
After a configured wait, half-open allows a small number of test calls, called probes. Successful probes can close the breaker. Failed probes open it again. This is a repeating recovery cycle, not a promise that waiting repairs the service.
Keep three settings separate: the deadline for each call, the window that counts failures, and the time spent open before testing recovery. Modern breakers can also detect slow calls. They do not all wait for complete failure. Local memory and concurrency bounds still protect the caller while outcomes are pending.
A circuit breaker changes whether the caller attempts a dependency operation. A fallback can avoid waiting for another failing call.
Example trip rule: three observed failures in a 60-second window. Open refuses locally; it does not cancel every call already admitted.
After the open wait, half-open admits limited probes. Their outcomes determine the next state; passage of time does not repair the dependency.
Keep call deadline, observation window, and open-state wait separate. Modern implementations can include slow-call criteria as well as errors.
Content revision: 07c7dd00db17
Download review copy (27 lessons)Does an expired open-state wait prove the suggestions service recovered?
No. It permits a limited recovery test. Failed probes can reopen the breaker; the application can keep showing a cheap list.
Choose counted failures, observation window, request deadlines, open-state wait and probe count separately. Keep local resource bounds.
Three failures in sixty seconds is an illustrative basic policy, not a universal default. Some breakers also use slow calls or resource limits.
Start here. No earlier lesson is required.
100 arrivals/s − 80 completions/s = 20 extra unfinished requests/s.
Timeout, cancellation, connection failure, and operation outcome are different facts.
Application-owned local admission protects room to finish work and respond.
Database unavailable → calls wait or fail → unbounded retained app work can cause further failure.
A sampling window is not a concurrency ceiling. Define failure classification and cancellation; bound calls already admitted before a trip.
Original explanation inspired by Fred Hébert and operational references; no endorsement implied.
AI-generated narration: ElevenLabs Eleven v3, Daniel stock voice. Audio streams only when you start listening.
A tour of the common Redis-based rate limiter implementations — and the correctness and performance traps each one hides.
The myth of infinite serverless scale — why adding machines doesn’t fix overload, and what to do instead.