Fault domains and multi-AZ patterns
Start with a failure boundary
High availability means the checkout service remains usable when a defined component fails. A fault domain is a group of components that can fail together, such as an Availability Zone (AZ). Three instances in one AZ are not equivalent to three instances in separate AZs. Start with the availability objective, then identify the failures that the design must tolerate. A regional outage is outside a single-Region multi-AZ design.
Capacity after losing an AZ
Consider three AZs, each with two workers rated at 40 requests per second in a fictional load test. Normal capacity is 240 requests/s. Losing one AZ leaves 160 requests/s, enough for a peak of 150 under the model. At 180 requests/s, replicas alone are insufficient. Keep pre-existing spare capacity rather than relying on a successful scaling operation during failure. Real capacity depends on latency, database limits and uneven traffic distribution.
Trace the failure tree
Use an Application Load Balancer across AZs and an Auto Scaling group for stateless workers. Keep session state outside local memory, in a suitably resilient store. Health checks should detect inability to serve without making every optional dependency a reason to remove every worker. Draining lets in-flight work finish within configured bounds. A single shared database, egress path or configuration dependency can defeat replica isolation. The tree below describes possible causes, not measured probabilities.
checkout unavailable (OR) shared database unavailable surviving worker capacity below demand routing path unavailableBound the blast radius
Partition tenants into independent cells when shared capacity causes correlated failures; a cell should have bounded size and isolated dependencies. Use a queue for non-urgent receipts, not as a substitute for checkout durability. Measure success rate and latency per AZ and cell. Practice: remove AZ-b in the offline fixture and then mark the database unavailable. Explain why the first can succeed and the second cannot. Additional spare capacity has a cost, but removes a dependency on emergency scaling.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Fault domains and multi-AZ patterns — knowledge check
Reason about failure isolation, retry budgets and regional consistency.
Which design reduces an AZ failure domain?
Two remaining AZs each support 80 requests/s. What is the modeled capacity?
Why keep spare capacity already running?
All workers rely on an unavailable single database. What is the risk?
What is a cell boundary intended to do?