# Retry with Exponential Backoff

> Try a failed call again. Wait longer before each new try.

**Field:** Software Development  
**Category:** Architecture  
**Also known as:** Exponential Backoff, Backoff, Retry Logic, Jitter

## Think of it like

Think of it like knocking on a door. If no one comes, you wait a bit longer before each new knock.

## Definition

Retry with backoff means trying a failed call again, and waiting longer each time. A common plan doubles the wait each time: 1 second, then 2, then 4, then 8. Many failures are brief, so a retry often works. Waiting longer each time gives a struggling service room to recover. A little random extra wait, called jitter, stops many clients retrying at the same moment.

## Example

Emma's app fails to reach the payment service. It tries again after 1 second, then 2, then 4. The third try works, and the customer never notices.

## Example code

```javascript
for (let i = 0; i < 5; i++) {
  try { return await callPayments(); }
  catch { await sleep(1000 * 2 ** i); } // 1s, 2s, 4s, 8s, 16s
}
```

Each failed try waits twice as long as the one before it.

## Why it matters

Networks drop calls all the time. Smart retries turn many small failures into nothing at all.

## Common mistake

Retrying at once and forever. Thousands of clients doing that can keep a service down after it tries to come back.

## Three principles

- **Try again.** Many failures are brief.
- **Wait longer each time.** Often double.
- **Add jitter.** And a limit.

## Related terms

- [Circuit Breaker Pattern](https://learn.benibix.com/term/development/circuit-breaker)
- [Distributed System](https://learn.benibix.com/term/development/distributed-system)
- [Service Mesh](https://learn.benibix.com/term/development/service-mesh)
- [Rate Limiting](https://learn.benibix.com/term/development/rate-limiting)
- [Model Fallback](https://learn.benibix.com/term/development/model-fallback)
- [Timeout](https://learn.benibix.com/term/development/timeout)

## Told apart from

- [Circuit Breaker vs Retry with Backoff](https://learn.benibix.com/compare/circuit-breaker-vs-retry-with-backoff): People think a circuit breaker is just a limit on retries, and it is not. A retry tries one failed call again, waiting longer each time. A circuit breaker watches all calls to a service. Once too many fail, it stops sending any for a while. Retries help with a short blip. The breaker helps when a service is truly down.

---

Source: https://learn.benibix.com/term/development/retry-with-backoff
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
