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.
Two tenants, separate policy decisions
Not Northstar’s usage.
Maya belongs to this customer.
O square = Orchid. N circle = Northstar. Arrows follow each tenant’s decision, not dedicated hardware. Northstar is assumed within its own policy; other checks still apply.
Read the numbered steps in order. The explanation below follows the narration.
Account for recent use within one tenant’s scope.
A rate limit enforces an allowance, not a measurement of current resource health.
A rate limit enforces an allowance, not a measurement of current resource health.
A rate limit answers a specific question: has this tenant used its allowance recently? The allowance is how much work the policy permits. A time window is the period over which that use is considered.
For a simple example, suppose Orchid may start sixty ordinary reports per minute. The next report may be refused when its allowance is exhausted. The response can use HTTP status four twenty-nine, meaning too many requests for this policy. No expensive report should start after that refusal.
The exact algorithm matters. Some policies permit a short burst, meaning several requests close together. RateLimitly uses an estimate that decays over time; do not mistake this example for an exact calendar-minute counter. A work weight charges a more expensive operation more than a cheap one, when the application can assign meaningful relative costs.
Does sixty requests per minute guarantee low memory usage? No. Those requests can take different amounts of time and memory. The allowance controls recent use, while the application's local protection still controls its own resource risk.
Each tenant has its own intended usage record. Orchid’s use does not consume Northstar’s allowance; both still use shared infrastructure.
Allowance and time scale form a policy. This is a question about recent use, not a measurement of memory or database health.
The number describes the intended policy. It is not a display of an exact fixed-window counter. Northstar keeps its own allowance.
Here Orchid has exhausted its allowance while Northstar remains within its own. Maya’s work may pass this fairness check; it must still pass other required checks.
This is the application responding to Orchid’s excess request. It is not a database error and does not say that the entire service is down.
The refused branch must skip the costly operation. Returning 429 but continuing the same report in the background defeats this protection.
Time passing reduces estimated recent use. Do not infer a fresh full allowance at the next calendar minute from this example.
A policy charge can represent relative cost. It still is not a direct reading of current memory or database capacity.
Longer operations can retain more simultaneous work even at a bounded start rate. Keep application-owned memory and concurrency bounds alongside tenant fairness.
Content revision: 07c7dd00db17
Download review copy (27 lessons)Sixty requests pass the policy. Are their memory costs necessarily equal?
No. Request costs and durations vary; weights help express a policy but do not replace resource protection.
Choose a tenant scope, allowance, time scale, and any meaningful work weights. Check before costly work and handle a policy denial explicitly.
The sixty-per-minute example illustrates a policy, not an exact fixed-window guarantee of RateLimitly’s decaying estimator.
Start here. No earlier lesson is required.
100 arrivals/s − 80 completions/s = 20 extra unfinished requests/s.
Application-owned local admission protects room to finish work and respond.
Contain one customer's excess before it harms other customers.
A rate bound is not a concurrency bound. Long-lived accepted work can accumulate even when its start rate is limited.
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.