advanced
Bulkhead
Isolate pools, queues, threads, or capacity so one dependency or tenant cannot consume resources needed by the whole service.
Bulkheads partition resources — thread pools, connection pools, queue capacity, rate limits — so overload in one area does not exhaust the whole service. Named after ship compartments that contain flooding.
Trade-off: reserved capacity may sit idle while another partition starves if sizing is wrong.
On interviews: apply bulkheads to a service calling both fast cache and slow payment API; explain tenant isolation.
Common pitfalls: one giant pool for all dependencies; bulkheads without metrics; no rejection policy when partition is full.
Checklist:
- Separate pools per critical dependency or tenant.
- Define max concurrency and queue limits.
- Reject or shed load when partition saturates.
- Monitor utilization per bulkhead.