Archprimer
PatternIntermediate 6 min read

Bulkhead

Isolate resources like thread pools and connection pools into partitions so a failure or overload in one area cannot sink the entire system.

bulkheadisolationresiliencefault-tolerance

By Ratish Jain · Updated

Diagram with 5 components: Requests, Dispatcher, Pool A, Pool B, Slow Dep. Connections: Requests → Dispatcher (1 in); Dispatcher → Pool A (2 critical); Dispatcher → Pool B (3 batch); Pool B → Slow Dep (blocks).
ClientServiceExternal
Separate pools isolate failure

Definition

The bulkhead pattern partitions resources — thread pools, connection pools, or service instances — so that each workload runs in its own isolated compartment. The name comes from a ship's hull, divided into watertight sections so one flooded compartment doesn't sink the vessel.

If one partition is exhausted by a slow or failing dependency, the others keep serving traffic.

The Problem It Solves

In a shared thread pool, a single slow downstream call can consume every thread while blocked. Requests to *healthy* endpoints then starve because no threads remain — one bad dependency takes down unrelated functionality.

Bulkheads cap the blast radius: the misbehaving workload can only exhaust its own compartment's resources.

How It Works

  1. 1Identify workloads or dependencies that should be isolated (e.g. critical vs. batch).
  2. 2Assign each its own resource pool — separate thread pool, connection pool, or instance group.
  3. 3Cap the size of each pool so it cannot borrow from others.
  4. 4Route each request type to its designated pool.
  5. 5When one pool saturates, requests to it queue or reject while other pools stay unaffected.
  6. 6Monitor per-pool utilization to tune sizes.

Bulkhead vs circuit breaker

Bulkhead vs circuit breaker

They are complementary. A bulkhead limits how much damage a failing dependency can do by capping its resources; a circuit breaker stops calling it altogether. Production systems often use both together.

Tradeoffs

Pros
  • Contains failures to a single partition.
  • Protects critical workloads from noisy neighbors.
  • Preserves partial availability under overload.
  • Makes resource limits explicit and tunable per workload.
Cons
  • Lower overall resource utilization (pools can't share).
  • Requires capacity planning per partition.
  • Too-small pools throttle legitimate load.
  • More configuration and monitoring surface.

Interview Questions

Why not use one big shared thread pool for efficiency?

A shared pool maximizes utilization but has no isolation: one slow dependency can block every thread, starving all other requests. Bulkheads sacrifice some utilization to guarantee that a failure stays contained to its own pool.

How do you size bulkhead pools?

Base each pool on the dependency's expected concurrency and latency (Little's Law: threads ≈ throughput × latency), reserve headroom for critical paths, and monitor saturation to adjust. Critical workloads get generous, guaranteed capacity.

60-Second Revision
  • →Partition resources into isolated compartments.
  • →One saturated pool can't starve the others.
  • →Named after watertight ship compartments.
  • →Complements circuit breakers (contain vs. cut off).
  • →Trades some utilization for fault isolation.

Related

Everything on Archprimer is connected — follow the graph.