We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Microservices Architecture
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Microservices Architecture
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
You call a friend. No answer. You call again immediately. No answer. You call again. And again. And again. Every 2 seconds, you call. Your friend's phone is buzzing non-stop, and if they were about to pick up, your constant calling is making it harder.
Now imagine 10,000 clients doing this to a struggling server. Each client retries every 100 milliseconds. The server was overloaded handling 10,000 requests per second, now it's getting 30,000 because everyone is retrying instantly. The server never recovers because the retries never let up.
Exponential backoff is the grown-up version of retrying. Instead of retrying immediately, you wait. And each subsequent retry waits exponentially longer. 100ms, 200ms, 400ms, 800ms, 1600ms. This gives the struggling service time to breathe, process its backlog, and recover.
Ethernet invented this in 1983 (IEEE 802.3). When two devices transmit simultaneously and collide, they each pick a random wait time from an exponentially growing window before retrying. Forty years later, the same algorithm runs in every AWS SDK, every client, and every Google Cloud library.
Exponential backoff uses this formula:
wait time = base * 2^attempt
| Attempt | Wait (base = 100ms) | Total Elapsed |
|---|---|---|
| 1 | 100ms | 100ms |
| 2 | 200ms | 300ms |
| 3 | 400ms | 700ms |
| 4 | 800ms | 1,500ms |
| 5 | 1,600ms | 3,100ms |
With a maximum cap (usually 30-60 seconds), so you don't end up waiting 17 minutes on attempt 20.
Compare to fixed-interval retry (100ms between every attempt):
| Approach | 5 Retries Total Time | Load on Server |
|---|---|---|
| Fixed 100ms | 500ms | 5 requests in 500ms, aggressive |
| Exponential | 3,100ms | 5 requests over 3.1 seconds, gentle |
The trade-off is clear: exponential backoff takes longer to exhaust all retries, but it puts dramatically less pressure on the failing service. For transient failures, the first or second retry usually succeeds. The extra time for later retries is rarely needed.