NewThe Learning module is now liveSee what's new
Beginner
Timeouts, Retries, and Backoff
30 min readChapter 15Optional

1. Timeouts, Retries, and Backoff

The dependency you are calling does not go down cleanly. It gets slow. Your service keeps sending requests, each one waits, and the waiting is what eventually takes you down, not the failure itself. Caller-side failure handling is the set of policies your service applies to a dependency it does not control: how long you wait, whether you try again, how far apart the attempts go, how much total retry work you allow, and when you stop calling altogether. All five are decisions the caller makes alone, without cooperation from the thing that is failing.

In an interview, this topic usually begins when the interviewer points to one dependency and asks, "What happens when this is slow?" Adding a timeout and retry is only the starting point. You also need to explain how retries affect a dependency that is already struggling, because an unbounded retry policy can extend the outage it was meant to handle.

A complete policy needs five decisions: how long to wait, which failures to retry, how to space attempts, how much retry work to allow, and when to stop. The examples use one ride-hailing service so every number can be tied to a specific call and consequence.

premium content mask
Upgrade to premium and unlock full chapter
Spot an issue or have a suggestion?
Realtime Communication  |

Discussion

Upgrade to premium to read and join the discussion.