Tutorials System Design Mastery

Health Checks & Circuit Breakers: Preventing cascading failures

On this page

Preventing Cascading Failures

In a microservices world, if Service A is slow, Service B waits. If Service B waits, its memory fills up, causing it to fail. Soon, the whole company is offline. This is a Cascading Failure.

1. Health Checks

The Load Balancer constantly pings your servers (e.g., GET /health). If a server fails to respond 3 times, the Load Balancer automatically removes it from the pool. This is "Self-Healing" infrastructure.

2. The Circuit Breaker Pattern

If an external service (like a Payment Gateway) is failing, don't keep trying and wasting resources. "Trip" the circuit. For the next 60 seconds, all calls to that service fail immediately (or return a cached default). This gives the failing service time to recover and keeps your app alive.

4. Interview Mastery

Q: "What are the three states of a Circuit Breaker?"

Architect Answer: "1) **Closed**: Everything is normal, requests go through. 2) **Open**: Failures detected, requests fail immediately. 3) **Half-Open**: After a timeout, we allow a *single* test request. If it succeeds, we close the circuit. If it fails, we go back to Open. This state machine is the foundation of library tools like **Polly** for .NET or **Hystrix** for Java."

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

System Design Mastery
Course syllabus
1. Distributed Systems Fundamentals
2. Database Scalability
3. Caching & CDN Strategies
4. Event-Driven Architecture
5. High Availability & Load Balancing
6. Microservices & API Gateway
7. Monitoring & Disaster Recovery
8. FAANG System Design Interview
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details