API / Microservices Design Patterns Interview Questions
What is the Bulkhead decomposition pattern and how does it isolate failure domains?
The Bulkhead pattern — named after the watertight compartments in a ship's hull that prevent a single breach from flooding the entire vessel — partitions a system into isolated failure domains so that a critical failure in one domain cannot cascade to others. In the context of service decomposition, it means deliberately grouping services, their infrastructure, and their resource pools into segments that share no mutable state or critical resources with adjacent segments.
A concrete decomposition example: an e-commerce platform partitions into a Browse & Search bulkhead (product catalog, search index, recommendations) and a Checkout & Payments bulkhead (cart, order placement, payment gateway). Even if the Elasticsearch cluster powering search becomes overloaded or crashes entirely, the checkout flow is completely unaffected — it uses a separate set of services, database clusters, thread pools, and message broker topics.
Isolation strategies applied at each level:
- Process isolation — separate containers or OS processes mean a crash or OOM in one service does not affect another.
- Thread/connection pool isolation — each downstream dependency gets its own bounded pool, preventing a slow dependency from exhausting shared resources (this is the resource-level Bulkhead, covered in Q28).
- Infrastructure isolation — separate database clusters, separate message broker partitions, and separate network segments per bulkhead limit the blast radius of an infrastructure failure.
- Deployment isolation — placing bulkheads in separate Kubernetes namespaces, availability zones, or cloud regions ensures that a zone-level outage affects only one bulkhead.
The trade-off is cost: infrastructure isolation requires duplicated resources. Bulkheads are most justified on revenue-critical paths where the cost of cascading failure — lost transactions, SLA breaches, reputational damage — outweighs the overhead of duplication.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
