Bulkhead Pattern
The bulkhead pattern isolates a service's resources — thread pools, connection pools, semaphores — into separate partitions per downstream dependency, so that a slow or unresponsive dependency can only exhaust its own partition and cannot starve resources needed for other dependencies.
The bulkhead pattern isolates a service's resources — thread pools, connection pools, semaphores — into separate partitions per downstream dependency, so that a slow or unresponsive dependency can only exhaust its own partition and cannot starve resources needed for other dependencies.
What the diagram shows
This flowchart illustrates a service (Service A) that calls three downstream dependencies: a Payment Service, an Inventory Service, and a Notification Service. Without bulkheads, all three share a single thread pool. A slow Payment Service response causes threads to pile up waiting, eventually exhausting the pool and causing Inventory and Notification calls to fail — even though those services are healthy.
With bulkheads applied:
1. Partition resources: each dependency gets its own dedicated thread pool (or semaphore limit). The sizes are tuned to the expected call volume and acceptable latency of each dependency. 2. Requests acquire from partition: when Service A needs to call a dependency, it acquires a slot from that dependency's partition. 3. Partition full: if the Payment partition is exhausted, only Payment calls are rejected. Inventory and Notification partitions are unaffected. 4. Fail fast on exhausted partition: the caller receives an immediate error rather than waiting, preventing thread accumulation.
Why this matters
The term comes from ship design: a ship's hull is divided into watertight compartments (bulkheads) so that flooding one compartment doesn't sink the whole ship. The same logic applies to software: one failing dependency shouldn't bring down the entire service.
Bulkheads pair naturally with Circuit Breaker Pattern — the circuit breaker detects sustained failures and stops sending requests, while the bulkhead limits the blast radius when the circuit hasn't opened yet. Together they form the core of defensive microservice design. See also Rate Limiting Architecture for external traffic controls.