Search DistillSys

Find a concept

Type at least two characters to search lessons, designs, papers, and interview prep.

Reliabilityintermediate7 min read

Failure & Retry Patterns

Recover from transient failure without turning retries into a synchronized overload event.

2–5 minute refresher
Mental model

Bound waiting → retry less often → randomize → cap work → shed load

30second
refresher
Reliable remote calls need bounded timeouts, exponential backoff, jitter, idempotency, retry budgets, and overload protection. Retries help transient faults only when the downstream system has capacity to recover.

How the control loop works

Timeouts bound resource occupancy. Backoff spaces repeated attempts. Jitter prevents clients from synchronizing. Retry budgets cap amplification. Circuit breakers stop known-bad calls, while bulkheads and load shedding preserve critical capacity.

Decision guide

Key trade-offs

ChoiceWhat you gainWhat it costs
Aggressive retryFast recovery from rare packet lossLoad amplification and duplicate work
Circuit breakerStops repeated calls to a failing dependencyCan delay recovery if thresholds are poor
Load sheddingPreserves useful work under saturationExplicitly rejects lower-priority requests
What happens if?

Ten thousand clients retry after the same timeout

Without jitter they return together, creating a retry storm that prevents the dependency from recovering. Randomized backoff spreads demand across time.
What happens if?

Three service layers each retry three times

One user request can create up to 27 downstream attempts. Retry at one well-chosen layer and propagate a shared deadline so deeper services cannot outlive the request budget.
Senior interview modeWhy should retries have a budget?Show answer
Retries consume the same constrained capacity as original traffic. A budget limits amplification, protects recovery, and forces the system to fail deliberately rather than extend an outage.
#retries#timeouts#backoff#circuit-breaker