← Lessons

quiz vs the machine

Gold1430

System Design

The Bulkhead Pattern

Isolating resources so one overloaded feature cannot sink the whole ship.

5 min read · core · beat Gold to climb

A metaphor from ships

A ship is divided into watertight compartments called bulkheads. If one floods, the others stay dry and the ship survives. The bulkhead pattern applies the same idea to software: partition resources so a failure in one part cannot drain everything.

The failure it prevents

Imagine all requests share one thread pool. If a slow downstream dependency ties up every thread, even unrelated healthy endpoints stall. One sick feature has sunk the whole service. This is resource exhaustion cascading.

How bulkheads work

  • Give each dependency or tenant its own pool of threads, connections, or memory.
  • When one pool is exhausted, only calls needing that pool are affected.
  • The rest of the system keeps serving normally.

The cost is lower overall utilization, because reserved capacity in one pool cannot be borrowed by another. You trade some efficiency for fault isolation.

Key idea

The bulkhead pattern partitions resources into isolated pools so a failure in one cannot exhaust the resources of the rest.

Check yourself

Answer to earn rating on the learn ladder.

1. What problem does the bulkhead pattern prevent?

2. What is the main cost of using bulkheads?