How it works · 25 of 49 Advanced

What are bulkheads and load shedding in system design?

Sink one compartment, not the ship

Bulkheads & load shedding: Bulkheads give each caller (or each dependency) its own pool of workers, connections or instances, so a surge or a hang in one fills only its own pool. Load shedding protects what is left: when a pool is full, extra requests are turned away at once instead of queueing, because a queued request that finishes after the caller's timeout is wasted work, and an overloaded server that keeps queueing ends up serving almost nobody in time. Shed the least important work first. The price: idle capacity kept in reserve, and some callers told "not now".

Loading the animation…

Say it like this Bulkheads give each caller its own pool of workers so one surge floods only its own compartment, and load shedding turns extra requests away at once so the requests you accept are answered in time; together they keep an overload from sinking the whole service.

Under the hood — for builders
The sources, in their words
Microsoft ("Bulkhead pattern", Azure Architecture Center, 2026): "Isolate the elements of an application into pools so that if one element fails, the others continue to function." David Yanacek ("Using load shedding to avoid overload", Amazon Builders' Library, 2019): "When a server gets so overloaded that its latency exceeds its client's timeout, requests start to fail."
Run here: one pool or three
Pool: the workers (threads, connections) a caller may use. 20 workers; Checkout 20 requests a second and Search 30 (0.1 s each), a crawler surging at 300 (0.2 s each); callers give up after 1 s. Checkout requests answered in time:
Run here: goodput, with and without shedding
Goodput: requests answered in time, per second (Yanacek's term). One compartment of 10 workers (100 a second). Shedding: reject at once when the queue is more than 0.3 s deep.
Why it collapses
Yanacek: the server keeps finishing requests whose callers have already timed out; "the last thing a system should do in an overload situation ... is waste work."
How to build them
Microsoft: one connection pool per dependency; thread pools or semaphores per caller (resilience4j, Polly); separate processes or containers per tenant group.
What to shed first
Yanacek: "The most important request that a server will receive is a ping request from a load balancer"; human page views before crawlers. Rejecting must be cheap.
Measure it
Goodput, not throughput · requests rejected by priority · queue age · per-pool saturation and SLA (Microsoft: monitor each partition).
Watch out
Microsoft: not suitable when "Less efficient use of resources might not be acceptable": a reserved pool sits idle until it is needed. Our run is a toy queue.
Sources
Microsoft, "Bulkhead pattern", Azure Architecture Center, 2026 · David Yanacek, "Using load shedding to avoid overload", Amazon Builders' Library, 2019 · both read in session · pool and shedding simulation, Python, 19 Nov 2026.

What happens in the bulkheads & load shedding animation, step by step?

  1. One service, 20 workers, three callers: Checkout, Search and a search-engine crawler.
  2. One shared pool: the crawler's surge takes every worker, and Checkout sinks with it. Under 1% answered in time.
  3. Bulkheads give each caller its own workers. The crawler floods only its own compartment; Checkout and Search stay dry.
  4. Your turn: drag the traffic into one compartment up, past the 100 a second its workers can serve.
  5. Without shedding, a queue builds and every answer comes too late. Shedding waves extras off at once and keeps 100 a second on time.
  6. Shed the least important work first; never the load balancer's ping. Next: undoing a transaction that spans services.

What everyday example explains bulkheads & load shedding?

A ship's watertight compartments. One floods, the ship floats; and a full boat waves off the next boat instead of sinking under it.

Why should a team care about bulkheads & load shedding?

A spike passed an hour ago and the service is still down because it is busy finishing work nobody is waiting for. Separate pools and early rejection are what let it serve somebody.