Sub topic 3
Finding failure domains and single points of failure
This chapter assumes you know what a VPC, a subnet, and an EC2 instance are, and that you have read the earlier chapters on RTO, RPO, Regions, and Availability Zones (AZs). Here you learn to look at an architecture and find what can take it down.
Failure domains
A failure domain is the set of resources that can fail together because they share a cause. On AWS, the common domains are nested:
- A single instance, volume, or container.
- An Availability Zone, which shares power, networking, and facilities.
- A Region, which shares a control plane and regional services.
A single point of failure (SPOF) is any component that has no redundant peer in a failure domain, so its loss stops the workload. Multi-AZ design means no SPOF exists at the AZ level.
A repeatable method
Walk each request path from the user to the data and ask the same questions at every hop.
- List every component on the path: DNS, load balancer, compute, cache, database, egress.
- Record which AZ each component runs in, using AZ IDs, not names.
- Mark components that exist only once, or only in one AZ.
- Ask what happens if that AZ becomes unreachable.
- Ask whether recovery needs a person or an API call, such as launching a replacement.
The web tier and load balancer survive an AZ loss. The database does not, so the whole workload does not.
Common SPOFs
| Component | Why it is a SPOF | Typical fix |
|---|---|---|
| Single EC2 instance | Instance or AZ failure ends service | Auto Scaling group across AZs |
| Subnets in one AZ | Every resource shares that AZ | Subnets in at least two AZs |
| One NAT gateway | It is zonal, so other AZs lose egress if it fails | One NAT gateway per AZ |
| Single-AZ database | No standby elsewhere | RDS Multi-AZ or Aurora |
| EBS volume | A volume lives in one AZ | Replicate data or snapshot it |
| Hard-coded IP or hostname | Traffic is pinned to one target | Use load balancer or DNS names |
| Local session state | Losing the instance loses the sessions | Move state to a shared store |
Hidden SPOFs
Some SPOFs are not boxes on a diagram.
- Dependencies. A third-party API or a shared internal service may sit in one AZ.
- Control-plane actions. If recovery means launching new instances during an outage, capacity may be scarce exactly when you need it.
- Configuration. A bad deployment goes to every AZ at once. Redundancy does not protect against it.
- Quotas. A shared limit, such as an instance quota, can block scaling in every AZ.
Checking where things run
You can list your account's name-to-ID mapping with the CLI:
aws ec2 describe-availability-zones \
--query 'AvailabilityZones[].[ZoneName,ZoneId]' \
--output tableThen compare the AZ ID of each subnet with the components on your request path. Any tier whose resources all map to one ID is a candidate SPOF.
Exercise
A web tier runs in two AZs behind an Application Load Balancer. Both AZs route outbound traffic through one NAT gateway in AZ A. AZ A fails. Which tier loses what, and what is the fix?
Show answer
The instances in AZ B are still healthy, but they lose outbound internet access, because the NAT gateway is zonal and lived in AZ A. Any call to external services fails. The fix is one NAT gateway in each AZ, with each private subnet's route table pointing to the gateway in its own AZ.