Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Courses/Reliability and Failure
Lesson 8 of 24

Bulkheads and fault isolation

Partition resources so that one failing dependency, tenant or request type cannot sink the whole service.

15 min read

The ship analogy

A ship's hull is divided into watertight compartments so that one breach floods one compartment, not the whole ship. In software, a bulkhead gives each dependency, tenant or workload its own slice of resources. Without one, a service with a single shared pool of 200 threads is only as healthy as its slowest dependency: if the image service hangs, all 200 threads end up waiting on it and checkout, search and login fail too.

Bulkheads inside a service

Within a process, isolate by giving each downstream dependency its own bounded resources. The aim is that when one dependency hangs, only the requests that need it fail, and everything else keeps its normal latency.

  • Separate connection pools or concurrency limits per dependency, for example 50 for payments and 20 for recommendations
  • Separate worker queues for interactive and batch jobs, so a backfill cannot delay user requests
  • Bounded queues that reject when full rather than grow without limit

Bulkheads across the fleet

At larger scale, isolate whole groups of instances. Cell-based architecture runs several independent copies of the stack, each serving a fixed subset of customers; a bad deploy or poison request takes down one cell, perhaps 5% of users, rather than everyone. Shuffle sharding assigns each tenant a random small set of instances: with 8 instances and 2 per tenant there are 28 combinations, so a tenant sending poison requests shares its full set with very few others.

Cost of isolation

Bulkheads trade efficiency for safety. Dedicated pools leave capacity idle that a shared pool could have used, and more cells means more infrastructure to operate. Size each bulkhead from the traffic it serves plus headroom, and reserve the strongest isolation for the dependencies and tenants most likely to misbehave. On the SystCode canvas, separate queues or worker pools per provider are how you keep one slow provider from failing a whole scenario.

Key takeaways

  • One shared resource pool lets the slowest dependency take down everything
  • Give each dependency and workload its own bounded pool or queue
  • Cells and shuffle sharding limit the blast radius of bad tenants and bad deploys
  • Isolation costs idle capacity; spend it where failures are most likely

Sign in to track lessons and earn badges.

Circuit breakersGraceful degradation and failing dependencies

Challenge checkpoint

Course: 0/24 lessons · 0/10 challenges0%

Build it on the canvas, pass the review (70+) and mark it complete to count it toward the course badge.

  1. 1/10Design a Web CrawlerUse per-host timeouts, bounded retries and bulkheads so one slow or hostile site never stalls the whole crawl.Medium
All 10 challenges →