# Circuit Breaker

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

- **Category**: Cloud
- **Subcategory**: aws
- **Canonical URL**: https://designpattern.fyi/patterns/aws_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 to allow for recovery testing.


## 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://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/circuit-breaker.html)

