Retry
Retry sends a failed call again if the error is temporary and the operation remains safely repeatable. Limitation and pause keep the additional load controllable.
- BackoffDelays increase with each attempt.
- JitterRandom offsets spread client retries.
- LockstepSynchronized retries create load spikes.
Context
Why this is important
Temporary errors often disappear on their own, permanent ones do not. Whoever repeats immediately or in fixed time, often meets the service again at the same time. Growing, scattered breaks give him air. Timeout and Retry Storm.
This building block describes repetition rules for individual calls. Retry Storm considers the common burden of many clients; Idempotence protects business effects.
At a glance · Retries with increasing delay
Compare four retry strategies
The shop loads the shopping cart again after a short connection error. It repeatedly limits and shows the stored cart status after the last attempt.
This is how you read the picture
- Backoff “Exponential backoff” schedules attempts at 200, 600, 1,400, and 3,000 ms.
- Jitter With “Backoff with jitter”, “at most simultaneous” is 1 instead of 3.
- Lockstep With “Retry immediately”, all three clients arrive at the same time.
Time after the first failure
Times illustrative
Benefits & limitations
Helps if:
- Retries suit transient technical failures with a realistic prospect of later success.
- Safe operations or stable duplicate detection allow controlled retries of the same operation.
Boundaries
- Permanent failures persist after every attempt; classify them as terminal and pass them to error handling without further retries.
- If the shop retries a payment call, P-731 may take effect twice; protect it with Idempotency and the key pay-B-1042.
- Multiple retry layers multiply load; choose one layer and examine the interaction in Retry Storm.
In practice
- Define failure classes. Distinguish transient technical failures, permanent rejections and unknown outcomes. Assign each class a retry rule and an exit path. This produces consistent decisions that callers and operations teams can handle in the same way.
- Establish retry safety. Check whether the operation can run again without duplicate effects or whether the recipient recognises the same request. Record this precondition together with the request key. Resending then remains tied to the same business operation.
- Bound time and attempts. Set the maximum attempt count, backoff, jitter and shared deadline, and measure budget usage. Also define the response when the budget is exhausted. This caps additional load and waiting time.
Read the detailed explanation
Retry repeats a failed operation when the detected failure class suggests a transient problem. Before each attempt, retry safety, the remaining deadline and the maximum attempt count must align. A permanent business rejection needs different handling. For side effects, the distinction from Idempotency matters; waiting time follows the shared Timeout budget.
Backoff increases the pauses; jitter spreads attempts over time. A bounded retry budget protects the dependency and keeps total duration predictable. Retry controls whether and when to send again; it does not determine whether the recipient already executed the first attempt. Resolving that question belongs to the operation state and appropriate duplicate detection.
Check your understanding
Test yourself in three stages
ReadingCheck in the picture
When is exponential backoff the third attempt, and how many clients arrive at the same time?
View the solution with justification
In case of: 1.400 ms after the first error, and all three clients arrive simultaneously.
ApplyingTransferred to a new situation
Three clients retrieve the shopping cart after the same error. The tip shall be of 3 on 1 decrease. What strategy do you choose?
View the solution with justification
Backoff with jitter. The random factors between 0,5 and 1,0 distribute the experiments so that at most one arrives at the same time.
EvaluateWeighing an alternative
The team proposal is: exponential backoff without jitter is enough. What speaks for it, what speaks against it, what do you recommend?
View the solution with justification
For this: simple and predictable. On the other hand: All clients remain synchronous, the top remains at 3 It is repeated in every attempt. Recommendation: Complement jitter, limit attempts and total time, and resend only securely repeatable calls.
Explore further
These building blocks continue the thoughts of this page.
References
- Microsoft – Retry pattern (opens in new tab)Describes operational limits and repetition strategies for temporary errors.
- AWS – Timeouts, retries, and backoff with jitter (opens in new tab)Explains timeouts, limited repetitions, and jitter based on distributed failures.
- AWS – Making retries safe with idempotent APIs (opens in new tab)Shows how Idempotence prevents double side effects of repeated calls.