# Circuit Breaker

> Handle faults that might take variable time to fix when connecting to remote services

- **Category**: Cloud
- **Subcategory**: azure
- **Canonical URL**: https://designpattern.fyi/patterns/azure_circuit_breaker/

---

## Description
The Circuit Breaker pattern handles faults that might take a variable amount of time to fix when an application connects to a remote service or resource. It prevents cascading failures by stopping calls to a failing service after a threshold of failures is reached. The circuit transitions between closed, open, and half-open states.


## Use Cases
Use when connecting to remote services that may experience intermittent failures or when you need to prevent cascading failures in distributed systems.





## Trade-offs


### Advantages

- Prevents cascading failures

- Improves system resilience

- Automatic recovery detection

- Reduces load on failing services




### Considerations & Drawbacks

- Adds complexity to service calls

- Requires threshold tuning

- May mask underlying issues







---
**Reference**: [Original Source](https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker)

