Retries 00:00:01 The coffee order with a missing reply A cafe's payment terminal encounters a temporary connection problem. A retry may recover quickly, but only if the failure is retryable, enough time remains, and repeating the operation is safe. The connection is refused. That is temporary, and nothing was processed. One second of base plus a random part. Two seconds plus a random part. 1.23 + 2.67 equals 3.9 seconds of waiting so far. Success. Two attempts were still left. Name the limit in total attempts to avoid off-by-one settings. Include the wait and the next attempt in the caller's deadline, then return a meaningful uncertain outcome if the limit is reached. 00:00:51 Ten terminals should not share one alarm Every terminal notices the same outage. A fixed retry interval brings them all back together. Exponential backoff widens the interval, and jitter lets each terminal choose a different time within it. No wait. Fine once, for a lost race. Harmful against overload. 1 second each time. 1, 2, 4, 8, together 15 seconds. A random wait below each limit. This draw takes 7.4 seconds, the average is 7.5. Cap the wait so the operation still has useful opportunities to finish. Jitter spreads retries over time. It cannot fix a service that has no capacity for even its normal workload. 00:01:42 The second charge carries the first receipt number The payment reaches the processor and commits just before the network loses the reply. To the cafe the timeout looks like a failure. Repeating the charge under a fresh identity could bill twice. The shop sends 20 dollars with key pay_abc123. The charge and the key are stored together. The connection breaks. The shop sees a timeout and does not know. Same key. Payments finds it and returns the stored result. No second charge. The payment provider should atomically recognize the same operation key and return its recorded outcome. Keep the original request parameters tied to that key and account for its retention period. 00:02:28 A four-attempt policy can become sixteen calls The gateway and orders service both decide to retry. Multiply their maximum attempts along the call path and suddenly the failed stock service receives sixteen attempts per original request. 100 requests, 100 calls. Orders makes up to 4 attempts. Stock is down and sees 400. The gateway also makes 4. 100 times 4 x 4 equals 1,600 calls against a service that is already down. A small pool of retry tokens limits the number of extra attempts across all callers. Replenish it at the configured rate and stop retries when it is empty. Concentrate retries where enough context exists to classify the failure. A retry budget bounds amplification across traffic, and circuit breaking or load shedding can protect the recovering dependency. 00:03:23 Set aside the broken order so others can finish For background work, write the next attempt to a delayed queue instead of sleeping inside a front-line worker. Eventually a bounded policy needs to park a permanently failing item where somebody can inspect it. The worker calls and gets a 503. The job goes to the delay queue for about 1 minute. Nobody is waiting on a page. After attempt 5 it goes to the dead letter queue and somebody is told. The company is back. The parked jobs are put in again, slowly, with the same keys. When the provider recovers, redrive at a controlled rate with the original operation keys. Measure successful requests recovered per extra attempt, and watch what those attempts cost during an outage.