Intermediate · INTERACTIVE LESSON
Retries and backoff
Compare fixed delays, exponential backoff and jitter as multiple clients retry a failing service.
The interactive player is loading. If it does not appear, you can still read the explanation below.
THE IDEA BEHIND THE STEPS
How it works
A retry sends another attempt for the same logical request after a retryable failure. Retrying can recover from transient failures, but every attempt adds service load. This lesson assumes idempotent operations: repeating them does not duplicate side effects. Permanent errors should not be retried blindly.
Fixed delay waits the same time after each failed response. Capped exponential backoff doubles the delay for each retry, up to the maximum delay. The first retry waits the base delay (or the maximum, if smaller), then twice the base, then four times, and so on. Synchronized clients can still retry together even with exponential backoff.
Full jitter samples a delay from zero through the capped exponential value. It spreads retries over time, though collisions remain possible. This simulation samples at millisecond resolution with a repeatable seed. Jitter does not guarantee fewer calls, earlier success or fair sharing. Compare the preset timelines to see the timing differences.
Maximum attempts includes the first call. A success ends the logical request; exhausting the attempt budget ends it with failure. Attempts of one logical request never overlap. The timeline shows processing bars and backoff gaps, while the counters separate logical outcomes from actual service attempts.
Concurrent bursts count total logical requests across clients, assigned round-robin. Sequential mode waits for success or budget exhaustion, then the arrival interval, before starting the next logical request. Each attempt takes the configured processing time and succeeds if it completes at or after service recovery. Completions precede sends at the same timestamp, ordered by request ID.
Network animation takes no simulated time. This model does not simulate timeouts, overall deadlines, Retry-After, queues, service capacity, or a circuit breaker. Production clients also need request deadlines, suitable timeouts, bounded retry budgets and safe-to-repeat operations. A timeout does not prove a side effect did not happen.