🏗️Circuit Breaker Pattern
Also known as Circuit Breaker
Stop calling a failing service for a while. Then trouble does not spread.
Think of it like
Think of it like the fuse box in a house. When something goes wrong, it cuts the power fast.
Example
Lucy's shop calls a slow reviews service. After 5 failures in a row, the breaker opens. Product pages load without reviews instead of hanging for 30 seconds.
Why it matters
Without it, one slow service can tie up every caller. Then the whole system goes down with it.
Definition
Common mistake
Key takeaways
- 1Count the failures. Then open.
- 2Fail fast. Do not wait on a dead service.
- 3Test, then close. One call to check.