- What are the three circuit breaker states?
- Closed (normal operation — requests pass through), Open (circuit tripped — requests fail fast without calling the dependency), Half-Open (test state — a single probe request is allowed to check if the dependency has recovered).
- How is a circuit breaker different from a timeout?
- A timeout waits for a slow response and eventually gives up. A circuit breaker monitors failure rates and proactively stops sending requests after a threshold is crossed — protecting the downstream service from additional load while it recovers.
- Where should circuit breakers be placed in an architecture?
- At every external dependency boundary: outbound HTTP calls, database queries, message queue consumers, and third-party API calls. Each should have independently configured thresholds based on that dependency's SLA.