🔌 Cloud, Scalability & Resilience · Cloud, Scaling & Resilience
Circuit Breaker
Temporarily stop calling a failing dependency.
Repeated calls to a broken service waste resources and spread failure.
After repeated vendor failures, return a controlled response and retry later.
💡 It is like the trip switch in your home: when something shorts, it cuts power instead of letting the fault burn down the whole house.
💡 Why it matters
When one service you depend on breaks, hammering it with retries makes everything worse — requests pile up, threads get stuck, and the failure spreads to healthy parts. A circuit breaker notices the trouble, stops calling for a while, and fails fast with a controlled response. This keeps one broken dependency from dragging down the whole system.
🛠️ How to achieve it
⚠️ Signs of trouble
- •A single slow dependency makes the whole system hang.
- •Failing calls are retried endlessly, piling pressure on an already-broken service.
- •One outage cascades outward until unrelated features stop working.
- •Requests wait on long timeouts instead of failing quickly.
🎯 Quick check
Score: 0/3Three questions to test the idea.
1. What does a circuit breaker do?
Answer: Temporarily stops calling a dependency that is failing
When a dependency keeps failing, the breaker opens and stops calls for a while to prevent spreading the failure.
2. Why is hammering a broken service with retries harmful?
Answer: It wastes resources and spreads the failure to healthy parts
Endless retries pile pressure on the failing service and freeze the callers, causing cascading failure.
3. What should a circuit breaker do before fully reopening?
Answer: Let a few trial requests through to check if the dependency recovered
A few trial requests after a cool-off reveal whether it is safe to close the breaker again.
