Circuit Breaker and Resilience Patterns#
In a microservice architecture, any downstream dependency can fail. Without resilience patterns, a single slow or failing service cascades into total system failure. Resilience patterns prevent this by failing fast, isolating failures, and recovering gracefully.
Circuit Breaker#
The circuit breaker pattern monitors calls to a downstream service and stops making calls when failures reach a threshold. It has three states.
States#
Closed (normal operation): All requests pass through. The circuit breaker counts failures. When failures exceed the threshold within a time window, the breaker trips to Open.