Circuit Breaker & Bulkhead
ReliabilityStops calling a failing downstream dependency for a cooldown period, preventing cascading failures instead of piling up timeouts.
Modeled directly on an electrical circuit breaker: when a downstream dependency starts failing or timing out heavily, a circuit breaker 'trips' (opens), and subsequent calls fail fast locally instead of waiting on a timeout against a dependency that's clearly unhealthy. After a cooldown, it lets a small trickle of requests through (half-open) to test if the dependency has recovered, and fully closes (resumes normal traffic) if so. The Bulkhead pattern is the companion idea: partition resources (thread pools, connection pools) per-dependency so one slow/failing dependency can't exhaust resources needed to call other, healthy dependencies — named after ship bulkheads that keep one flooded compartment from sinking the whole vessel.
How it connects
Circuit Breaker & Bulkhead as the source, with the components it typically interacts with.
- → API Gateway: Gateways wrap outbound calls to backend services in a circuit breaker so one unhealthy dependency degrades gracefully instead of cascading.
- → Service Discovery: When a breaker trips for one instance, the caller falls back to service discovery to route subsequent calls to a different healthy instance.
- → Service Mesh & Sidecar Proxy: Service meshes implement circuit breaking as a built-in sidecar feature, applied uniformly without each service needing its own client library.