Course contentsShow
← System Design
Lesson 1085 of 1,91927. Circuit Breakers and BulkheadsFree lesson

Preventing Cascades with Circuit Breakers and Bulkheads

How circuit breakers stop failure propagation and bulkheads contain failures, working together to prevent cascading system collapse.

Preventing Cascades with Circuit Breakers and Bulkheads

You'll learn: How circuit breakers and bulkheads work together as complementary defenses to stop cascading failures from destroying your entire system.

Two Patterns, One Mission

While circuit breakers and bulkheads each prevent failures independently, their combined use creates a layered defense that's far more effective than either pattern alone. Circuit breakers stop failure propagation by cutting off doomed requests, while bulkheads contain failures by isolating resources. Together, they prevent the domino effect of cascading system collapse.

How They Complement Each Other

Circuit breakers provide fast-fail protection. When a dependency starts failing, the circuit opens and immediately rejects new requests without even attempting them. This prevents threads from blocking, queues from filling, and retry storms from forming—all common cascade triggers.

Bulkheads provide resource isolation. Even if one circuit breaker trips, the bulkhead ensures that failure is contained to a specific resource pool (thread pool, connection pool, or semaphore). Other parts of your system continue operating with their own dedicated resources.

Real-World Combination

Imagine your API depends on three services: payments, notifications, and recommendations. You implement:

  • Circuit breaker per dependency: Payments failing won't flood the system with doomed retries
  • Thread pool bulkhead per dependency: Even if payment threads are exhausted waiting for timeouts, notification and recommendation threads remain available
  • Result: When payments fail, the circuit opens fast. The bulkhead ensures payment failures can't steal resources from other features. Your system degrades gracefully instead of collapsing entirely.

Without circuit breakers, slow failures consume bulkhead resources. Without bulkheads, a circuit breaker failure could still exhaust shared resources.

Key Takeaway: Circuit breakers and bulkheads are complementary patterns that together prevent cascading failures—breakers stop propagation through fast-fail, bulkheads contain damage through resource isolation.