Imagine a payment API going offline during checkout. If every request waits for a timeout, blocked threads and rising memory use can bring down your application too. A circuit breaker acts like an electrical breaker: it cuts the connection before a local failure spreads. section 10.3
A circuit breaker wraps calls to a dependency and monitors errors and timeouts. When failures cross a configured threshold, it opens and blocks further calls, returning an error or triggering a fallback immediately. This saves resources and gives the dependency breathing room to recover. section 10.3 section 10.3.2
The breaker moves between three states:
- Closed: Calls pass through normally while the breaker counts failures. A closed circuit is connected, not blocked. section 10.3.1
- Open: After the failure threshold is reached, calls are intercepted and fail fast. A threshold might be five consecutive failures or a 50% failure rate over 30 seconds. section 10.3.2
- Half-open: After a cooldown, one test request passes through. Success closes the breaker and restores normal traffic; failure reopens it and restarts the cooldown. section 10.3.3
Figure 10.4 The Circuit Breaker Pattern: Failing fast to prevent a localized dependency failure from cascading and burning down your entire application.

See how failing fast keeps a dependency failure from cascading through the application. section 10.3
Avoiding a retry storm
A brief payment API delay can turn a tight retry loop into thousands of immediate requests, adding pressure to an already struggling service. A circuit breaker stops calls when the service is failing; exponential backoff with jitter spaces retries instead of firing them all at once. section 12.8.3
A breaker is one part of a resilience plan, not a substitute for every safeguard. Timeouts limit individual waits, fallbacks offer a plan B, and bulkheads isolate resources so one dependency cannot consume all available capacity. section 10.10 section 10.3.3













