Retry Strategies: Exponential Backoff & Jitter
Prevent self-inflicted retry stampedes: Linear vs Exponential backoff, Full Jitter, Equal Jitter, Decorrelated Jitter, and retry budgets.
01.1. The Anatomy of a Retry Storm (Self-Inflicted DDoS)
In distributed systems, transient network glitches, TCP resets, and brief CPU spikes are inevitable. A naive implementation attempts to handle network errors by immediately retrying the failed request:
typescript// β NAIVE IMMEDIATE RETRY ANTI-PATTERN async function naiveFetch(url: string, retries = 3) { for (let i = 0; i < retries; i++) { try { return await http.get(url); } catch (err) { if (i === retries - 1) throw err; // Immediate retry with 0ms delay! } } }
Why This Destroys Backend Infrastructure:
- A backend database experiences a momentary
200mslock stall. 5,000in-flight client requests time out.- All
5,000clients immediately retry at the exact same millisecond. - The incoming traffic instantly doubles to
10,000 QPSon a server that was already struggling. - The Retry Storm: A minor transient hiccup escalates into a complete, permanent system outage as cascading retries overwhelm the server.
Synchronized Retry Wave Stampede vs Exponential Backoff with Full Jitter π
Synchronized Retry Wave Stampede vs Exponential Backoff with Full Jitter π
Without jitter, failed clients retry in synchronized spikes, repeatedly crushing the recovering server. Full jitter spreads retries uniformly across time.
Unlock Topic #150: Retry Strategies: Exponential Backoff & Jitter
You are viewing a preview. The full in-depth engineering deep dive, interactive simulators, architecture flowcharts, and self-assessment quizzes for this topic are available with Pro or Lifetime Access.
Failure modes, high-throughput bottlenecks, and real FAANG implementation decisions.
Interactive system topology diagrams, live parameter simulators, and downloadable SVG charts.
Staff-level multiple-choice quiz questions with instant feedback and answer explanations.
Firebase Google authentication automatically syncs your completed topics and quiz scores.
How clear and staff-actionable was this system breakdown?