AI Hints
Home›System Design Tutorial›Surviving Failure
System Design · Lesson 82 of 120

Single Points of Failure

Find them, remove them.

⏱ 2 min read▶ Video at 1:38:42🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

A single point of failure is any part that, if it breaks, takes the whole system down. Finding them is like walking through your design, and asking of every box, what if this dies?

Single Points of Failure
From the video: Single Points of Failure
  • One part breaks
  • Everything stops
  • Ask: what if this dies?

Shoply's weak spots

Let's walk through Shoply. One load balancer is a single point of failure, so we run two. One database leader is one too, so we keep a replica ready to take over. One data centre could lose power, so we use several availability zones. Even one engineer who knows how to deploy is a risk.

PartFix
One load balancerrun a pair
One DB leaderstandby replica
One data centreseveral zones
One region's DNSmanaged, redundant DNS
One engineerdocs and automation

Redundancy adds nines

Redundancy is powerful because failures multiply. If one server is up ninety nine percent of the time, two independent servers are both down only one percent of one percent of the time. Run it. One server gives two nines. Two give four nines. Three give six.

redundancy.pypython
single = 0.99

for copies in [1, 2, 3]:
    all_down = (1 - single) ** copies
    print(f"{copies} copies: available {1 - all_down:.6%}")
Output
1 copies: available 99.000000%
2 copies: available 99.990000%
3 copies: available 99.999900%

Summary

A single point of failure brings everything down. Find them by asking what if this dies, and remove them with redundancy. Next, switching to the backup automatically.

Key takeaways
  • Ask of every box
  • Add redundancy
  • Copies multiply nines
Next up: Failover — switching to the backup