SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
  • Scalability
  • Availability
  • Reliability
  • Single Point of Failure (SPOF)
  • Latency vs Throughput vs Bandwidth
  • Consistent Hashing
  • CAP Theorem
  • Fault Tolerance and Redundancy
  • Failover
  • Stateless vs Stateful
  • Concurrency vs Parallelism
  • Capacity Planning
  • Back Pressure
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Foundations/Core Concepts

Single Point of Failure (SPOF)

One part that, if it breaks, stops the whole system.

⏱ 10 min readBeginnerMust KnowInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

A Single Point of Failure (SPOF) is one part of a system that, if it breaks, stops the whole system.

  • It can be a server, a database, a load balancer, a network link, a person, or even a DNS record.
  • We fix it by adding a backup copy (redundancy) and automatic switching (failover).
  • But the fix can bring its own SPOF. Always ask: β€œwhat if this part dies?”.

02Concept: What is it?

Look at your system as a chain. A chain is only as strong as its weakest link. If one link has no spare, it is a SPOF.

A chain with one weak link
πŸ‘₯Users
→↓
βš–οΈLoad balancer2 copies
→↓
πŸ–₯️App
πŸ–₯️App
→↓
πŸ—„οΈOne databaseSPOF!
Three of four parts have copies. The database does not. It is the SPOF.
🧠Test question
Pick any box in the diagram. β€œIf this one stops, does the user still get served?” If the answer is no, it is a SPOF.

03Real-Life Example

🍡One key to the house
A family has one key. The person with the key goes out and loses it. Nobody can get in. The key is a single point of failure. The fix: make spare keys and keep them in different places.
One key vs spare keys
One key
πŸ”‘Only key
↓
πŸšͺLocked out
Spare keys
πŸ”‘Key 1lost
πŸ”‘Key 2at a neighbour
↓
🏠Family gets in
House
Software system
One key
One server or one database
Spare keys
Redundancy
Keys in different places
Copies in different zones
Neighbour opens the door
Failover

04Why Do We Need It?

One small part can cause a big outage. Finding it early is much cheaper than finding it during an outage.

πŸ’₯Small cause, big outage
A cheap part can stop an expensive product.
πŸ“ˆBetter availability
No SPOF means more uptime.
😴Fewer 3 AM calls
Failures fix themselves.
🧱Safe to grow
Scaling out removes many SPOFs.
If a part has no spare, it is only a matter of time before it fails.

05Where Do We Use It?

SPOFs hide in many places. Check each one.

WhereExample SPOFUsual fix
App serverOnly one server runs the appMany servers behind a load balancer
Load balancerOne load balancer in front of everythingTwo load balancers (active-passive or active-active)
DatabaseOne database holds all the dataReplicas and automatic failover
NetworkOne internet link or one switchTwo links from two providers
DNSOne DNS providerUse more than one DNS provider
Data centreEverything is in one buildingUse many zones or regions
PowerOne power sourceBackup power (UPS and generator)
PersonOnly one engineer knows how it worksDocuments, shared knowledge, on-call team
Third-party serviceA key service you depend onFallback or a second provider

06Types / Parts / How It Works

How a system looks before and after

Before: three SPOFs
πŸ‘₯Users
→↓
βš–οΈLoad balancer
→↓
πŸ–₯️App server
→↓
πŸ—„οΈDatabase
The load balancer, the app server and the database each have no spare.
After: every layer has a spare
πŸ‘₯Users
→↓
βš–οΈLB 1
βš–οΈLB 2
→↓
πŸ–₯️App 1
πŸ–₯️App 2
πŸ–₯️App 3
→↓
πŸ—„οΈPrimary DB
πŸ—„οΈReplica DB
Single point of failure Has a spare
Any one box can fail and users are still served.

Two kinds of spare

Active-passive
  • The spare waits and does nothing
  • Takes over when the main one fails
  • Simple, but the spare is idle
Active-active
  • All copies share the work
  • If one fails, the others take its share
  • Uses all hardware, but needs more care with data
VisualizerBreak a part. Does the system survive?Click any box to fail it. Compare the Before and After designs.
Design
πŸ‘₯Users
↓
Entry: OK
↓
App servers: OK
↓
Data: OK
↓
βœ…Users are served
System
UP
Parts broken
0
Single points of failure
2
Load balancer, Database
Click any part to break it. Try the load balancer and the database in the Before design.

07How to Use It / Steps / Implementation

  1. 1
    Draw the system
    Every part and every arrow, including DNS, network and third parties.
  2. 2
    Ask β€œwhat if this dies?” for each part
    Mark every part that stops the whole system.
  3. 3
    Rank by risk
    How likely is it to fail? How bad is the damage?
  4. 4
    Add redundancy
    Add a copy of the part, in a different zone if possible.
  5. 5
    Add health checks and failover
    Switch to the spare automatically.
  6. 6
    Check the new parts
    The thing that does the switching can be a SPOF too.
  7. 7
    Test it
    Turn a part off on purpose and watch what happens.
⚠️Fixing one SPOF can create another
Two load balancers need something to decide which is active. If that one decider has no spare, it is the new SPOF. Keep asking the question.

08Key Terms to Know

TermMeaning in easy words
SPOFSingle point of failure: one part whose failure stops everything
RedundancyHaving spare copies of a part
FailoverMoving work from a failed part to its spare
FailbackMoving work back to the original part after it is repaired
ReplicaA copy of a database or server
HeartbeatA regular β€œI am alive” signal between parts
Health checkA test that tells if a part is working
Blast radiusHow much of the system is hurt when one part fails
Fault toleranceWorking even when a part fails
Bus factorHow many people can leave before the team is stuck. 1 means a human SPOF

09Pros, Cons and Trade-offs

βœ… Pros
  • System survives single failures
  • Higher availability
  • Maintenance without downtime (take one copy out at a time)
  • Peace of mind
⚠️ Cons
  • Extra hardware and cost
  • More moving parts to run
  • Data copies must stay in sync
  • Failover itself can have bugs

Trade-offs

ChoiceWe gainWe lose
Add a second copySurvive one failureDouble cost for that part
Active-passiveSimple switchingIdle spare
Active-activeBetter hardware useHarder data syncing
Many regionsSurvive a whole region outageHigh cost, more delay and complexity
πŸ’‘Not every SPOF must be removed
A SPOF in a tiny internal tool may be fine. Remove SPOFs in proportion to what an outage costs.

10Common Problems and Mistakes

Common mistakes

  1. Only looking at servers. DNS, network links, power and certificates can be SPOFs too.
  2. Spares in the same place. Two servers on the same power strip fail together.
  3. Untested failover. A switch that was never tried may not work.
  4. Shared dependency. Two β€œindependent” servers use one database. That database is the SPOF.
  5. Forgetting people. Only one person knows the password or the deployment steps.
  6. An expired certificate or domain. A tiny item can take the whole site down.

Problems when you add spares

🧠Split brain
Both copies think they are the main one. They both accept writes, and data conflicts.
πŸ”„Out-of-sync copies
The spare has old data when it takes over.
🚨False failover
A short network blip makes a needless switch.

11Real-World Examples

These are general ideas of real, well-known outage patterns. Exact company details are more complex.

🌐One DNS provider
If a site depends on a single DNS provider and it has an outage, users cannot find the site, even though the servers are fine.
🏒One data centre
A power or cooling problem in one building can stop a service that lives only there.
πŸ“œExpired certificate
When a security certificate expires, browsers refuse to open the site. Automatic renewal avoids this.
☁️Cloud zones
Cloud providers let you spread servers across zones, so one zone failing does not take you down.
A shared dependency hides a SPOF
πŸ–₯️App 1
πŸ–₯️App 2
→↓both need
πŸ—„οΈOne databasehidden SPOF
Two app servers look independent, but both need one database.

12Related Topics to Read Next

Availability→

Removing SPOFs is the main way to raise it.

Reliability→

Fault tolerance needs spare parts.

Scalability→

Scaling out also adds spares.

What are Load Balancers?β†’

They hide failed servers, but can be a SPOF themselves.

DNS Load Balancing→

One way to spread traffic across many entry points.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • βœ”What: one part whose failure stops everything.
  • βœ”Test: β€œIf this dies, are users still served?”
  • βœ”Hiding places: load balancer, database, DNS, network, power, data centre, certificates, people.
  • βœ”Fix: redundancy + health checks + automatic failover + different zones.
  • βœ”Styles: active-passive and active-active.
  • βœ”Watch out: split brain, shared dependencies, untested failover.
  • βœ”Balance: remove SPOFs in proportion to the cost of an outage.
  • βœ”One line: β€œA chain is only as strong as its weakest link, so give every link a spare.”
← Previous
Reliability
Next β†’
Latency vs Throughput vs Bandwidth