Circuit Breaker Pattern

Learn the Circuit Breaker design pattern and its usage.

Intent

This pattern improves a system’s stability and resilience by guarding integration points against cascading failures and slow responses from external systems.

Context and problem

We have seen how the Retry pattern can help us overcome transient failures, such as slow network connections or temporarily overloaded services, by retrying the same operation. Sometimes, a failure may require human interaction to rectify it, or its recovery can take forever. There is no benefit in retrying the same operation repeatedly and putting additional load on an already struggling system in similar situations. Instead, the application should detect that the remote service is unavailable and deal with it gracefully until the service is back and healthy again.

Get hands-on with 1400+ tech skills courses.