Circuit Breaker vs Retry
A dependency is failing. Decide whether to wait and try again, or open the circuit and fail fast while it recovers.
The rule
Prefer Retry with backoff for transient faults on a healthy dependency. Prefer Circuit Breaker when repeated calls make the outage worse or exhaust your own pool.
Choose Circuit Breaker when
Failures cluster, callers pile up, and you must shed load until a probe proves recovery.
Choose Retry when
Errors are brief, idempotent, and a short backoff restores the call without cascading.
Situation
Your service calls a dependency over the network. Timeouts and 5xx responses appear. Retrying forever can melt the dependency. Opening too early can hide a blip that a single backoff would clear.
Counter-signals
- The call is not idempotent — unbounded retry duplicates side effects.
- The budget is already spent — another retry violates the caller SLA.
- Only one instance is sick — a breaker on the whole pool hides healthy peers.
- Failures are rare and short — a breaker adds ceremony without reducing harm.
Deep links
Left patternCircuit Breaker
Stop cascading failures from taking down your system. How the Circuit Breaker pattern trades slow timeouts for fast, honest failure — with a correct TypeScript implementation.
Right patternRetry
The first resilience pattern everyone writes and the one most often written wrong: why naive retries amplify outages, and how backoff, jitter, budgets, and idempotency turn a retry into a safe one.