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

Per-Dependency Circuit Breakers

Isolating failures by maintaining separate circuit breakers for each downstream dependency rather than global breakers.

Per-Dependency Circuit Breakers

What you'll learn: How isolating circuit breakers per downstream dependency prevents cascading failures and improves fault isolation.


The Problem with Global Circuit Breakers

Imagine you have a service that calls three different downstream services: a payment processor, an inventory database, and a notification service. If you use a single, global circuit breaker for all of them, one failing dependency can break everything—even the healthy ones.

When the notification service starts timing out, the global breaker opens and suddenly your perfectly healthy payment and inventory calls also fail. That's like cutting power to your entire house when just one faulty appliance trips.


The Per-Dependency Solution

Per-dependency circuit breakers maintain separate, independent circuit breakers for each downstream service. Each dependency gets its own state tracking (closed/open/half-open), its own failure counters, and its own threshold configuration.

When the notification service degrades:

  • Its circuit breaker opens → notification calls fast-fail
  • Payment service breaker stays closed → payments continue working
  • Inventory service breaker stays closed → inventory lookups succeed

The failure is isolated. Your system maintains partial functionality instead of total collapse.


Configuration Flexibility

Different dependencies have different reliability profiles. Your critical payment API might warrant a conservative threshold (trip after 3 failures), while a less-critical recommendation service could tolerate more failures before opening (say, 10 failures).

Per-dependency breakers let you tune each one independently based on its importance and expected behavior.


Key Takeaway:
Per-dependency circuit breakers isolate failures to individual downstream services, preventing one failing dependency from breaking unrelated functionality and allowing fine-tuned failure handling for each integration point.