Resilience: Retries, Timeouts & Circuit Breakers
Networks fail. Services crash. Timeouts expire. Without resilience patterns, one slow dependency cascades into a system-wide outage — the classic cascading failure. Three patterns defend against this.
Timeouts cap how long a caller waits. Retries re-attempt transient failures (network blip, 503) with exponential backoff and jitter so you do not hammer a recovering service. Circuit breakers stop calling a failing service entirely after a threshold of errors, giving it time to recover while the caller fails fast or returns a fallback. Together they turn "everything is down" into "this one feature is degraded."
Exercise
For one outbound dependency, define timeout, max retries with exponential backoff+jitter, and a circuit-open behavior (fail fast or fallback). Write the policy as config comments even if you use a library sketch.