How it works
A retry helps when a failure is brief and the service has spare capacity. During overload it adds work to a system that cannot finish what it has. For example, a service handles 1,000 requests per second and normally receives 800. A 30-second slowdown makes requests time out, and clients retry each one up to 3 times, so load can reach 3,200 per second. Timed-out requests are still queued, so the server spends its capacity on work whose callers have left. Almost everything times out, which produces more retries. When the slowdown ends, the overload continues, because retries now sustain it.
Exponential backoff doubles the wait between attempts, such as 100, 200, then 400 ms, up to a cap. Jitter randomizes each wait, commonly between zero and the current backoff value, because clients that failed together otherwise retry in waves. A retry budget caps retries as a share of normal traffic. At 10 percent, load tops out at 880 per second, below capacity, so the queue drains. Backoff alone sets no bound: new requests keep arriving, and each can still make every attempt.
Layers multiply too. If the client, API, and database driver each make 3 attempts, one user action can become 27 database calls. Retry at one layer, and only for failures that can succeed: not a validation error, or a charge with no idempotency key. A budget’s cost is that some requests fail fast instead of eventually succeeding. Notification System retries provider calls with backoff and jitter, and Google Drive uses both to avoid reconnection storms.
The client SDK makes up to 4 attempts, a load balancer up to 2, and your API up to 4 against the database. A 20-second database blip became a 40-minute outage, with retries near their maximum throughout. You can ship one change today. What is it?
In the worst case one action makes 4 × 2 × 4 = 32 database calls, so cut the amplification first. Keep retries at one layer, most likely the client SDK, which knows whether an operation is safe to repeat, remove the others, and add a retry budget there. Backoff and jitter are worth adding next, but they spread that load rather than cap it.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Retries can make overload outlast its trigger by keeping the queue full.
- Backoff spreads retries, jitter decorrelates them, and a budget caps their total.
- Retry at one layer, since attempts multiply across layers.