CodePark/ questions / Offline & resilience
START PRACTICINGPRACTICE
Frontend question · Frontend system design › Offline & resilience

A request to load comments fails with a 503. What retry policy should the client use?

Retry a few times with exponential backoff and jitter, honouring Retry-After

Retry a few times with exponential backoff and jitter, and honour Retry-After. Backoff means each wait is longer than the last. Jitter adds a small random amount to each wait. Together they spread retries out, so many clients do not hit a struggling server at the same moment. A cap on the number of retries stops endless retrying. "Retry immediately in a tight loop" and "Retry every 1 second forever" are the tempting wrong answers. When many clients retry like this, the outage gets worse.