Implementing the bulkhead pattern
Bulkheads are structural partitions used in ships to create individual watertight sections. The primary purpose is to contain the consequences of any breach in the ship’s hull, thereby preventing water from spreading throughout the vessel in the event of damage. This design serves as a crucial safety measure, aiming to minimize the risk of the entire ship sinking if one area is compromised.
The same concept is helpful to limit the scope of failure in the architecture of large systems where you want to partition your system to decouple dependencies between services. The idea is that one failure should not cause the entire system to fail, as shown in the following diagram:
Figure 4.10: Bulkhead pattern
In the bulkhead pattern, it’s better to isolate the element of the application into the pool for service, which has a high dependency; so, if one fails, others continue to serve upstream services. Service 3 is partitioned...