Explain like I'm five · SRE

What is Retry with Backoff?

Retry with backoff, told as a story about guests who rest a moment before lining up again after being turned away.

BOOTHgot rejected... back in line right awayrejected guests line right back up immediately, and the booth gets even busier

Rejected guests line right back up immediately, and the booth gets even busier.Retrying instantly, with no rest, gives the booth no breathing room.

BOOTHall the rejected guests line up again at the exact same momentif everyone retries at once, the crowding only gets worse

If everyone retries at once, the crowding only gets worse.Everyone comes back at the same instant, in one big wave.

BOOTHI'll rest a bit, then line up againrest a moment, then line up again — each person waits a slightly different amountso everyone doesn't rush back at once

Rest a moment, then line up again — each person waits a slightly different amount.So everyone doesn't rush back at once.

Don't retry instantly — rest firstcatch your breath
Rest longer each timethat's exponential backoff
Vary it slightly per personthat's jitter
Give up after too many triesand try another way
1st fail1s + jitter2nd fail2s + jitter3rd fail4s + jittersuccesseach failure doubles the wait, and each person's wait is nudged slightly differently

Each failure doubles the wait, and each person's wait is nudged slightly differently.1 second, 2, 4 — it doubles each time.

rest, retry, rest, retry... it never endsRULEup to 3 times onlythen give up for good→ hand off to the circuit breakerretry forever and you just wait forever — you need a max count and the sense to give up

Retry forever and you just wait forever.You need a max count and the sense to give up.

In one breath

Retry with backoff = instead of retrying instantly, resting a bit after rejection, waiting longer each time it fails, with each wait nudged slightly differently per guest — and giving up after too many tries.

Resending a failed request, but doubling the wait each time, is called exponential backoff. Adding a random variation to that wait is jitter — without it, everyone retries at the exact same moment, a thundering herd. Once the max retry count is exceeded, give up and hand off to something like a circuit breaker instead.

When grown-ups say it

Retry
Lining up again after a failure. Doing it instantly only makes the crowding worse.
Exponential backoff
Doubling the rest time with each failure. 1 second, 2, 4 — it keeps doubling.
Jitter
Adding a small random difference to each person's wait. Keeps everyone from rushing back at the exact same moment.
Max retry count
The number of tries allowed before giving up. Without it, you just wait forever.
Timeout
The limit on how long one attempt is allowed to wait. Only after the timeout passes does it count as a failure and start a retry.
Circuit breaker
The red button that stops even retrying somewhere entirely broken. Exceed the max retries, and this takes over. → the red button you press when something breaks
Idempotency
Sending the same request more than once still gives the same result as sending it once. Retrying safely depends on this property being true.
Backpressure
The entrance slowing itself down when the inside is full. Too many retries piling up is exactly when this becomes necessary too. → slowing the entrance for a moment
Next story
You Can't Ride Twice on the Same Ticket →
Want another term as a picture book? Request →