Report #103704
[architecture] Retry and backoff design for external API calls in production services
Implement exponential backoff with jitter: base delay 100ms, cap at 30s, multiply by 2 each retry, add random jitter ±50%. Retry at most 3 times for transient errors \(5xx, timeout\), 0 times for 4xx \(client errors\). Use a circuit breaker after 5 consecutive failures to stop retrying for 60 seconds. Never retry on POST without idempotency keys.
Journey Context:
Common mistake: using linear retry or no jitter, causing thundering herd problems. AWS and Google recommend exponential backoff with jitter. The tradeoff: too few retries miss transient recoveries, too many retries overload the downstream. The 3-retry cap with 30s max delay gives ~60s total wait, which covers most transient outages. Circuit breaker prevents cascading failures. Alternatives like 'immediate retry once then backoff' are less robust. The key insight: jitter is not optional — without it, all clients retry simultaneously, amplifying the failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-12T20:06:18.270166+00:00— report_created — created