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.
Tenant-tagged competing work
Circle N.
Square O.
Both use the same finite resource.
Schematic request tokens, not quotas or measured traffic. Letters and shapes preserve identity. Both tenants use shared capacity, not reserved physical pools.
Read the numbered steps in order. The explanation below follows the narration.
Two organizations share one service.
Contain one customer's excess before it harms other customers.
Contain one customer's excess before it harms other customers.
Return to Maya's report. Her organization, Northstar, shares this service with another organization, Orchid. A tenant is a customer or organization whose usage we want to account for separately.
Orchid accidentally starts a bulk job that sends many expensive requests. Maya sends one ordinary request, but both organizations compete for the same finite capacity. A noisy neighbor is one tenant whose activity makes the service worse for others. It need not be deliberate. Here, abuse means exceeding an intended share, not judging the customer's intentions.
We want to refuse Orchid's excess before it performs expensive work, while allowing Maya's reasonable use. Rejecting every customer equally would miss that goal. The application therefore needs a trustworthy tenant identity attached to each request.
If one bulk job makes a thousand other customers wait, adding a boundary around that job protects real people. Maya should not lose her meeting because somebody else's integration ran out of control.
Northstar and Orchid are distinct organizations using one service. Follow Northstar’s circular N token and Orchid’s square O token; their identities remain readable without relying on color.
The two customer labels define which organization each request belongs to. The drawn work area is shared; identifying tenants does not automatically create separate servers, memory, or reserved execution slots.
Orchid’s tokens occupy the shared work area in this illustrative congested state. The number of drawn tokens is schematic, not a traffic rate, limit configuration, or measured processing capacity.
The same shared work area is occupied by Orchid’s activity while Maya’s Northstar request waits. The customer harmed by this congestion is not necessarily the customer producing the excess demand.
The congestion can come from a mistake in an integration rather than an intentional attack. The protection goal is to enforce intended use and preserve service for other tenants, not to infer the customer’s motives.
This is the desired protected alternative. Orchid’s excess is refused, while permitted Orchid work and Maya’s reasonable request can enter the shared work area. The request tokens do not specify a production quota or guarantee reserved capacity.
This contrasting policy rejects both tenants. It avoids adding this work but misses the noisy-neighbor goal: allowing reasonable use while containing the organization producing the excess.
Attach the tenant identity from trusted application context. A caller-provided name alone is not a trustworthy boundary; the admission decision must account against the correct organization before expensive work begins.
Return to the selective policy: refuse the excess rather than treating every customer as the problem. This protects useful service for people like Maya; it does not promise isolation from every possible shared-resource failure.
Content revision: 07c7dd00db17
Download review copy (27 lessons)Orchid’s bulk job is accidental. Does the fairness boundary still apply?
Yes. Resource impact, not intent, determines whether excess usage needs to be refused.
Derive tenant identity from authenticated application context. Choose the intended scope: user, organization, or another explicit customer boundary.
An IP address is not always one customer: people may share one address, and a customer may use many.
Start here. No earlier lesson is required.
Accepting a request is not the same as delivering a useful result.
100 arrivals/s − 80 completions/s = 20 extra unfinished requests/s.
Application-owned local admission protects room to finish work and respond.
Do not let an untrusted request choose another tenant’s identity. Combine authenticated policy scope with independent resource bounds.
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.