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

The Electrical Analogy

How circuit breakers in distributed systems mirror electrical circuit breakers that protect against overload and short circuits.

The Electrical Analogy

You'll learn: How circuit breakers in distributed systems borrow their name and behavior from electrical circuit breakers that protect homes from electrical overload.


When you plug too many appliances into one outlet, the electrical circuit breaker in your home "trips"—it cuts power to prevent wires from overheating and causing a fire. This same protective principle applies to distributed systems.

How Electrical Circuit Breakers Work

In your home's electrical panel, a circuit breaker monitors the current flowing through wires. If it detects:

  • Overload: Too many devices drawing power simultaneously
  • Short circuit: A dangerous direct path allowing excessive current flow

...the breaker opens (trips), stopping electricity from flowing until you manually reset it. The breaker sacrifices temporary convenience to prevent catastrophic damage.

The Software Parallel

In distributed systems, when a service becomes unhealthy:

  • Overload: Too many requests overwhelming the service
  • Short circuit: Immediate failures (timeouts, errors) with no successful responses

A software circuit breaker "trips" and stops sending requests to the failing service. Just like the electrical version, it:

  1. Detects abnormal conditions (failure rates exceeding thresholds)
  2. Opens to stop the flow (rejects requests immediately)
  3. Protects the system (prevents cascade failures)
  4. Allows recovery (periodically tests if service recovered)

Instead of protecting wires from melting, it protects your system from wasting resources on doomed requests and prevents overwhelming an already-struggling service.

Key Takeaway:
Circuit breakers in software directly mirror electrical circuit breakers: both detect dangerous conditions and immediately stop the flow (of requests or electricity) to protect the broader system from cascading damage.