What is exponential backoff, and why is jitter added to it?
Sketch your own answer first, then compare it with the one below.
A strong answer
Exponential backoff means waiting longer after each failed attempt, usually doubling the wait up to a cap. A client that is failing sends fewer and fewer requests, which gives a struggling dependency room to recover.
On its own it has a weakness. If many clients fail at the same moment, because a server restarted or a connection dropped, they all wait the same time and retry together. The retries arrive in waves, and each wave can be as big as the first.
Jitter adds randomness. With full jitter each wait is a random time between zero and the backoff ceiling, so the clients spread their retries over the whole window. The peak load falls, and the dependency sees a smoother stream.
Jitter spreads the same number of retries over time. It does not reduce the total. To cap the total you need a retry limit, a budget or a circuit breaker.
Sources
- Marc Brooker (2015). Exponential Backoff And Jitter.