Bulkhead Pattern

Resource isolation through thread pool isolation, connection pool isolation, and failure containment in microservices.

Overview

Overview The Bulkhead pattern isolates resources so that a failure in one component does not cascade to bring down the entire system. The name comes from ship design: a ship's hull is divided into watertight compartments (bulkheads) so that if one compartment floods, the rest stay dry and the ship stays afloat.

In microservices, the most common scenario is thread pool exhaustion. If your service uses a single shared thread pool to call all downstream dependencies, a slow dependency can consume all threads, preventing your service from handling any requests — even requests to healthy dependencies.

Bulkheads are a prerequisite for building resilient systems. They pair naturally with circuit breakers (which detect failure) by providing the isolation layer that contains the blast radius. At Amazon, every service call goes through an isolated resource pool, ensuring that a problem in one service cannot affect calls to other services.

Key concepts

  • Thread pool isolation
  • Semaphore isolation
  • Connection pool isolation
  • Process-level isolation
  • Failure containment boundaries
  • Resource partitioning strategies
  • Bulkhead sizing and tuning

Interview questions

  • How does thread pool isolation work and when should you use it?
  • What is semaphore isolation and how does it differ from thread pool isolation?
  • How do you implement bulkheads at different architectural layers?
  • How do you size and tune bulkheads in production?

Sign up free to read the full topic

More Microservices topics

Start free on Cariara · Coding problems · System design studio