Why you need it
You can have many servers and still go down completely, because they all depend on one thing that has no spare. That one thing is a single point of failure. Finding them before they break is one of the most useful habits in system design.
Think of it like this
A house with three bedrooms, two bathrooms, and one front door key. Lose that key and nobody gets in, however many rooms there are.
Where you’ll find it
- Facebook: In 2021 one wrong command cut its network off from the internet, and Facebook, Instagram and WhatsApp were gone for about six hours.
- Fastly: In 2021 one customer's setting triggered a hidden bug and took down a large part of the web for an hour.
- AWS: Splits each region into separate Availability Zones, with their own power and network, so one fire or power cut does not stop everything.
- Netflix: Runs Chaos Monkey, which switches off servers at random during work hours so hidden single points show up early.
What to know first
Redundancy. Having a spare of something, so the system keeps working when one copy breaks.
Failover. Switching to the spare when the main one breaks. It can be done by a person or happen by itself. See Failover and split brain.
How it works
- Follow one request from start to end. Write down every part it touches: name lookup (DNS), load balancer, servers, database, power, network, even the one person who knows the password. Each one is a suspect.
- Ask "what if this one stops?". For each part, imagine it switched off. If the whole system stops, it is a single point of failure. In the animation the servers were fine; the shared power box was not.
- Give it a spare. Two load balancers, a database copy ready to take over (Replication), two power feeds, two network links. Spares must be truly separate: two servers on one power strip still share a single point.
- Make the switch automatic. A spare nobody switches to does not help at 3 a.m. Use Health checks and heartbeats so broken parts are noticed in seconds and traffic moves by itself.
- Test it on purpose. Switch things off on a calm afternoon and watch what happens. A spare you have never tested is a hope, not a plan.
An example
A shop runs three web servers, one database and one load balancer.
A web server dies: the other two carry on. Not a single point.
The database dies: every page fails. The load balancer dies: nobody can reach anything. Both are single points.
The fix: a second load balancer, and a copy of the database that takes over when the main one stops. Now any one part can break and the shop stays open.
Further reading
- Static stability using Availability Zones, AWS Builders' Library. How Amazon designs systems that keep working when a whole data centre is lost. Start with this one.
- More details about the October 4 outage, Facebook Engineering. A short, honest write-up of one of the largest outages ever.
- Chaos Monkey, Netflix. The tool that made breaking things on purpose a normal practice.