Sub topic 2
How systems fail and where single points of failure hide
This chapter assumes you know basic client-server architecture, what a load balancer and DNS do at a high level, and what timeouts and health checks are. It builds on the previous chapter's availability math and prepares the ground for redundancy. Before you can remove a weak point, you need to know what kinds of failure exist and how to find the parts of a system that can take everything down.
What a failure is
A component fails when it stops doing what its callers expect. That is a wider definition than "it crashed". A database that answers every query in 40 seconds instead of 40 milliseconds has failed from the point of view of a web server with a 2-second timeout, even though the process is running and its port is open.
Three terms are used precisely in this field:
- A fault is the underlying defect or event, such as a full disk, a bad deploy, or a cut cable.
- An error is the incorrect internal state the fault produces.
- A failure is the visible deviation from the expected service.
A fault does not always become a failure. A redundant disk absorbs a disk fault and no user notices. Redundancy and failover are techniques for stopping faults from turning into failures.
Failure modes
A failure mode is the way a component misbehaves when it fails. The mode matters because each one needs a different detection method and a different response.
| Failure mode | What it looks like | Why it is hard |
|---|---|---|
| Crash-stop | The process or machine halts and stays down. | Easiest case. A missing heartbeat reveals it. |
| Crash-recovery | The component halts, restarts, and comes back, often with lost in-memory state. | It may return in the middle of a failover and confuse it. |
| Omission | Some requests or messages are dropped, while others succeed. | A single successful health check hides the problem. |
| Timing (slow) | Responses arrive, but too late. | The component looks alive but behaves as dead. |
| Partial or degraded | One feature, one shard, or one code path is broken. | A shallow health check passes while users see errors. |
| Network partition | Two healthy components cannot reach each other. | Each side believes the other has failed. |
| Byzantine | The component returns wrong or inconsistent answers. | It cannot be detected by checking liveness. Most redundancy designs do not cover it. |
Most production designs assume crash-stop and handle slow and partial failures as well as they can. Byzantine failures, caused by data corruption or software bugs that return wrong results, are usually handled with checksums, validation, and testing instead of failover.
Slow is worse than down
A component that is fully down fails fast. Callers get a connection error immediately and can try another endpoint. A slow component holds connections, threads, and memory while callers wait. If a service calls a slow dependency with no timeout, its own thread pool fills with waiting requests, and then it stops answering its callers too. The failure spreads upward through the call chain. This is a cascading failure.
The usual defenses are short timeouts, limits on concurrent requests to each dependency, and removing a slow instance from rotation. The later chapters on health checks and client resilience cover these in detail.
Correlated failures
The availability math from the previous chapter assumes components fail independently. Real failures are often correlated: one event takes out several components at once. Common causes are:
- A shared power feed, switch, or cooling system.
- The same software bug running on every replica.
- A configuration change pushed to all servers at the same moment.
- An expired certificate or credential used everywhere.
- A traffic spike that overloads all instances together.
Correlation is the main reason a calculated 99.99% often turns out to be much lower in practice. The next chapters on redundancy and fault domains address this directly.
Single points of failure
A single point of failure (SPOF) is a component whose failure stops the whole service, because nothing can take over its job. Finding SPOFs is the first step in a reliability review.
A practical test is to take each component in turn and ask: "If this disappeared right now, would the service stop?" If the answer is yes and no spare exists, you have found a SPOF.
The obvious ones
Some SPOFs are easy to see in an architecture diagram:
- One application server behind no load balancer.
- One database instance with no replica.
- One load balancer in front of many servers. Having many servers behind it does not help if the entry point is single.
The hidden ones
Hidden SPOFs are the ones that cause surprise outages. They sit outside the main request path in the diagram, or they are shared by components that look separate.
| Hidden SPOF | Why it hides |
|---|---|
| DNS provider or a single authoritative name server | Everything depends on it, but it is rarely drawn on the diagram. |
| Certificate or its renewal job | Works for a year, then fails for all users at once. |
| Authentication or identity service | Every service calls it, so its failure looks like a failure of everything. |
| Configuration or secrets store | Needed at startup, so a restart during its outage fails to bring services back. |
| Shared database used by "independent" services | The services are redundant, but the data layer under them is not. |
| Single network link, switch, or uplink | Servers are doubled, but both plug into the same switch. |
| Single availability zone or data center | Copies exist, but all in one building. |
| One person or one runbook | Only one engineer knows how to recover. This is an operational SPOF. |
| Deployment pipeline | Not needed to serve traffic, but needed to fix a bug during an outage. |
| Shared software version | Every replica has the same bug, so redundancy gives no protection. |
| Monitoring and alerting | If it fails silently, you lose the ability to see other failures. |
A useful habit is to separate runtime dependencies, which are needed for each request, from startup dependencies, which are only needed when something starts. Startup dependencies are the easiest to forget. A system can run happily for months and then fail to restart after a power event because its configuration service is itself down.
Redundancy that is not redundant
Having two of something does not guarantee that it is not a SPOF. Check these cases:
- Shared fate: two servers on the same host, rack, or power circuit fail together.
- Hidden capacity limit: two servers exist, but one cannot carry the full load. When one fails, the survivor overloads and fails too.
- Untested standby: a passive copy has never taken traffic, and its configuration has drifted.
- Single control path: the mechanism that performs the failover is itself one process on one machine.
Mapping dependencies
You find SPOFs systematically by drawing a dependency graph and checking it. The following Python sketch shows the idea. It takes a map of service dependencies and, for each component, reports which services would lose a required dependency if that component failed. It assumes every listed dependency is required and that there is no redundancy yet.
DEPENDENCIES = {
"web": ["load_balancer", "app"],
"app": ["database", "auth", "config"],
"auth": ["database"],
"config": [],
"database": [],
"load_balancer": [],
}
def affected_by(failed, deps):
"""Return the set of components that stop working if `failed` is down."""
down = {failed}
changed = True
while changed:
changed = False
for name, needs in deps.items():
if name not in down and any(n in down for n in needs):
down.add(name)
changed = True
return down
total = len(DEPENDENCIES)
for component in DEPENDENCIES:
impact = affected_by(component, DEPENDENCIES)
if "web" in impact:
print(f"SPOF: {component} (takes down {len(impact)} of {total} components)")Running it prints every component whose failure reaches the user-facing web service. In this graph that is all of them except none: load_balancer, app, database, auth, config, and web itself are each a SPOF. The database stands out because it takes down app, auth, and web, so its blast radius is the largest.
The output is only as good as the graph. The graph often misses dependencies that are not in code, such as DNS, certificates, and shared network paths. Interview the people who run the system and read incident reports to find them.
Blast radius
The blast radius of a failure is how much of the service it affects. A SPOF has a blast radius of the entire service. Reducing blast radius does not always mean adding spares. These techniques also help:
- Splitting users or data into independent cells or shards, so a failure hits only one slice.
- Rolling out changes gradually, so a bad change reaches 1% of servers first.
- Isolating resources with separate thread pools or queues per dependency, called bulkheads.
A diagram of a typical dependency chain
The application tier has two servers, so it is not a SPOF. Every other box on the path is.
Common mistakes
- Counting boxes instead of tracing dependencies. Ten servers sharing one database have the availability of that database.
- Reviewing only the request path and ignoring startup, deployment, and monitoring.
- Treating a passing health check as proof of health. A check that only tests whether a port is open misses slow and partial failures.
- Assuming independence. Always ask what two components share.
Summary
Failures come in several modes, and slow or partial failures are harder to handle than clean crashes. Correlated failures break the independence assumption behind availability math. A SPOF is any component without a substitute, and the most dangerous ones are hidden in shared dependencies, startup paths, and operations. The next chapter introduces redundancy as the way to remove them.
Exercise
An architecture has three web servers behind one load balancer, all three servers read from one primary database, and the TLS certificate is renewed by a cron job on a single admin machine. List the single points of failure, including one that is easy to miss.
Show answer
The load balancer and the primary database are SPOFs, because each is a single instance on the request path. The three web servers are not SPOFs, since any one can fail while the others serve traffic, provided the remaining two can carry the full load. The certificate renewal cron job on one admin machine is the easy-to-miss SPOF. If that machine fails, the certificate expires silently and every user gets a TLS error at once, even though all servers are healthy.
Exercise
Why is a service that responds in 30 seconds often more dangerous to its callers than a service that is completely down?
Show answer
A down service returns a connection error immediately, so callers can fail fast and try another endpoint. A slow service keeps connections and threads occupied while callers wait. Their resources fill up, they stop serving their own callers, and the failure cascades upward through the system.