Sub topic 10
Correlated Failures and Failure Domains
This chapter assumes you know how series and parallel availability are computed (the previous two chapters) and can read short Python snippets. It explains why the parallel formula often overstates what redundancy delivers, and how to design around that.
The independence assumption
The parallel formula from the last chapter is 1 - prod(1 - a). It is only valid if each copy fails independently of the others. Two servers at 99.9% each give 99.9999% only if one server's failure tells you nothing about the other's.
Real failures are often correlated. A correlated failure is one where a single cause takes down several components at once. Common causes:
- A bad deploy pushed to every replica.
- A shared power feed, network switch, or rack.
- A shared dependency, such as one database, DNS provider, or certificate.
- A configuration change or expired credential that applies everywhere.
- A traffic spike that overloads all replicas together.
When failures are correlated, adding more copies does little. The shared cause sets a ceiling on availability.
Failure domains
A failure domain is a set of components that can fail together because they share something. Typical domains, from small to large:
| Failure domain | Shared thing | Example event |
|---|---|---|
| Process or host | Machine, OS | Kernel crash |
| Rack | Power, top-of-rack switch | Switch failure |
| Availability zone | Building, power, cooling | Data center power loss |
| Region | Geography, regional control plane | Regional network outage |
| Software version | Code and configuration | Bug in a release |
| Provider or account | Vendor, credentials | Account suspension |
Redundancy only helps against failures that stay inside one domain. Two replicas in the same rack protect you from a host crash but not from the rack losing power. To survive a domain failing, place copies in different domains.
A model with a shared cause
You can model correlation by adding the shared cause as a component in series with the redundant group.
from math import prod
def series(*availabilities):
return prod(availabilities)
def parallel(*availabilities):
return 1 - prod(1 - a for a in availabilities)
replicas = parallel(0.999, 0.999) # two independent replicas
shared_switch = 0.9995 # both replicas sit behind one switch
print(f"independent assumption: {replicas:.6%}")
print(f"with shared switch: {series(shared_switch, replicas):.6%}")The first line prints about 99.9999%. The second prints about 99.95%, because the switch caps the whole group. Two replicas are only as available as the least available thing they both depend on.
The diagram shows two points where redundancy is cancelled. The switch is a single point of failure in front of the replicas. The database is a single point of failure behind them. Each one multiplies into the result as a series component.
Common errors
- Counting replicas, not domains. Five replicas in one availability zone are one domain with five copies. Count independent domains.
- Ignoring software. Identical code and configuration make a bug hit every replica. Staged rollouts and canary releases reduce this.
- Hidden shared dependencies. Two "independent" services that both call the same authentication service are coupled through it.
- Correlated load. When one replica fails, its traffic moves to the others. If they lack headroom, they fail too, which is called a cascading failure.
- Untested failover. A standby that has never taken traffic often fails when first used. Treat its availability as lower than the formula says.
Design responses
Spread copies across zones or regions so that one domain loss leaves others running. Roll out changes gradually to limit the reach of a bad release. Give each group of components its own dependencies where practical, an approach sometimes called cell-based or bulkhead design. Size the surviving replicas to absorb the load of a lost domain. Each step costs money and complexity, which the cost chapter returns to.
Exercise
Three replicas at 99.9% each sit in one availability zone. The zone's shared power and networking has an availability of 99.95%. What is the approximate availability of the whole group, and what limits it?
Show answer
The three replicas in parallel give 1 - (0.001)^3 = 0.999999999, about 99.9999999%. Multiplying by the zone's 0.9995 in series gives about 0.9995, or 99.95%. The shared zone limits it. Adding a fourth replica in the same zone changes almost nothing. Adding a second zone is what helps.