Bulkhead pattern
Concept
A resilience design pattern that isolates resources such as connection pools, worker capacity or queues per dependency or workload, so a failure in one part cannot exhaust resources needed by others.
Description
The Bulkhead pattern is a resilience design pattern that separates the elements of an application into isolated pools of resources, so that a failure in one element does not take down the rest. Resources that can be partitioned in this way include connection pools, worker capacity and queues. The name comes from the partitions in a ship's hull: when a leak occurs, only one section floods while the rest of the vessel stays afloat.
The pattern addresses a specific failure mode. When a service becomes overloaded or unresponsive, calls to it can tie up shared resources, such as a common connection pool. Once those shared resources are exhausted, calls to other, healthy services start to fail as well, and a local problem turns into a cascading failure. Assigning each dependency or workload its own pool of resources keeps the damage contained at its origin. The M365.FM episode "Why Microservice Architecture Slows Software Delivery" describes the goal in similar terms: the bulkhead pattern in microservice architecture is used to prevent faults in one part of a system from taking down the entire system, effectively locking down the failure to its origin.
In practice, the isolation can be applied at several levels. Service instances can be grouped into partitions based on consumer load and availability needs, and a consumer can hold a separate connection pool for each service it calls. Asynchronous services can be isolated through separate queues. Implementation mechanisms mentioned in Microsoft's Azure Architecture Center guidance include processes, thread pools and semaphores, containers and virtual machines, and resource requests and limits in Kubernetes. Which mechanism fits depends on how strong the isolation needs to be and what the platform offers.
The documented benefits are protection against cascading failure, partial functionality during an outage, and differentiated service quality. If one partition is saturated or failing, the other parts of the application can keep working, so users may still reach a reduced set of features instead of losing everything. Partitioning by consumer or workload also allows different levels of service, for example giving critical callers capacity that cannot be consumed by less important ones.
The pattern also involves trade-offs that need to be weighed. The strength of isolation, the cost and the operational effort have to be checked against the risk being addressed. Resource use can become less efficient, because capacity reserved for one partition cannot be borrowed by another when it sits idle. The granularity of the partitions is a design decision: too coarse and failures still spread, too fine and the overhead grows. Each partition also needs its own monitoring so that saturation or failure in one of them becomes visible.
The Bulkhead pattern is generally not used alone. Microsoft's guidance recommends combining it with Retry, Circuit Breaker and Throttling. The "Why Microservice Architecture Slows Software Delivery" episode places the bulkhead alongside the circuit breaker, which can stop requests from reaching unhealthy services based on thresholds for errors and timeouts and reroute traffic when a service fails. In that combination, the circuit breaker limits calls to a failing service, while the bulkhead ensures that whatever load still reaches it cannot consume resources that other parts of the system depend on.
Overview compiled with AI from M365.FM episodes and the facts on this page. You can improve it with the edit button below.
| Type | Concept |
|---|
Frequently asked questions
Questions marked with AI were written with AI from the facts on this page.
What problem does the Bulkhead pattern solve? (AI)
It prevents an overloaded or unresponsive service from tying up shared resources, such as connection pools, and thereby causing calls to other services to fail. By isolating resources per dependency or workload, a failure stays contained at its origin.
How can the Bulkhead pattern be implemented? (AI)
Common approaches include separate connection pools per called service, grouping service instances into partitions, and using separate queues for asynchronous services. Microsoft's guidance also mentions processes, thread pools and semaphores, containers and VMs, and Kubernetes resource requests and limits.
Which other patterns are combined with the Bulkhead pattern? (AI)
Microsoft's Azure Architecture Center recommends combining it with Retry, Circuit Breaker and Throttling. The pattern's trade-offs include less efficient resource use and the need to choose partition granularity and monitor each partition.
Community wiki
Short info above, community knowledge below: add practical tips, examples or corrections. New contributions are reviewed first; trusted members publish directly.
Experts and companies for this topic
Nobody has listed this topic yet. Add it to your profile.
Maintained by Mirko Peters (Microsoft MVP) · Last updated: