Single Point of Failure (SPOF)

Basics

Visual Representation

Rendering diagram...

What is it?

🔗 Think of it like a chain:

A chain is only as strong as its WEAKEST link. If one link breaks, the entire chain fails. A Single Point of Failure (SPOF) is that one weak link in your system — the ONE component that, if it goes down, takes EVERYTHING with it.

Imagine a city with only ONE bridge connecting two halves. If that bridge collapses, half the city is completely cut off. That bridge is a SPOF.

In tech: a SPOF is any component (server, database, network link, service) where failure causes the entire system to become unavailable. Good system design ELIMINATES single points of failure through redundancy.

💡 Simple Summary: SPOF = one component whose failure kills the entire system. Fix it by having backups (redundancy) for everything critical.

How it works — Like you're watching it happen

A system WITH SPOFs (bad):

  • Users → ONE load balancer → ONE app server → ONE database
  • The database server's disk fails at 2 AM.
  • The app server gets database errors. Can't read or write data.
  • Users see error pages. ENTIRE system is down.
  • On-call engineer wakes up, takes 2 hours to provision new database and restore backup.
  • 2 hours of complete downtime. Revenue lost. Users angry.
  • Same system WITHOUT SPOFs (good):

  • Users → TWO load balancers (active-passive) → MULTIPLE app servers → Database PRIMARY + REPLICA
  • The primary database fails at 2 AM.
  • Automatic failover: replica becomes the new primary within 30 seconds.
  • App servers connect to the new primary. Users might see a brief hiccup (1-2 seconds).
  • Alert fires. Engineer wakes up, but the system is already healthy. They provision a new replica calmly.
  • Near-zero downtime. Users barely notice.
  • But wait — doesn't eliminating ALL SPOFs make the system really expensive?

    Yes — there's a cost-reliability trade-off! Every redundant component costs money. A startup doesn't need 99.999% uptime (5 minutes downtime/year). A bank does. The goal is: identify SPOFs, assess their IMPACT, and add redundancy where the cost of downtime exceeds the cost of redundancy. Not everything needs to be redundant — just the critical path.

    Why should you care? (Interview perspective)

  • 🎯 Interviewers LOVE to ask "what are the single points of failure in your design?" — be ready to identify and fix them
  • Shows you think about reliability and production readiness
  • Leads to discussions about failover, redundancy, and high availability
  • Demonstrates mature engineering thinking (not just happy-path design)
  • Key Things to Remember

  • Common SPOFs — Single database server, single load balancer, single DNS provider, one data center, one deployment pipeline, single network link.
  • Redundancy fixes SPOFs — Two load balancers, database replicas, multi-AZ deployment, multiple ISP links.
  • Active-Active vs Active-Passive — Active-Active: both copies handle traffic (better utilization). Active-Passive: backup sits idle, takes over on failure (simpler).
  • Health checks detect failures — Load balancers ping servers every few seconds. If a server doesn't respond, traffic is redirected to healthy servers automatically.
  • Multi-AZ, Multi-Region — Even if you have 10 servers, if they're all in ONE data center and that building loses power — all down. Spread across Availability Zones (buildings) and Regions (cities).
  • DNS SPOF — If your DNS provider goes down, nobody can find your servers (even though they're running fine). Use multiple DNS providers. The 2016 Dyn attack proved this.
  • Human SPOF — If only ONE engineer knows how the system works, that's a SPOF too! Bus factor = how many people need to get hit by a bus before the project dies. Should be > 1.
  • Automatic failover — Manual failover (human triggers switch) is slow. Automatic failover (system detects failure and switches within seconds) is preferred for critical systems.
  • Testing failover — Netflix uses "Chaos Monkey" — randomly kills servers in production to verify failover works. Don't wait for real failures to discover your redundancy doesn't work.
  • Graceful degradation — Even with SPOFs, design the system so a failure reduces functionality instead of total outage. If recommendation service dies, show popular items instead of personalized ones.
  • Real Examples You Use Daily

    ☁️ AWS Availability Zones — AWS has multiple data centers (AZs) per region. If you deploy in us-east-1a ONLY, a power outage there = you're down. Multi-AZ deployment means us-east-1a fails, us-east-1b takes over. No SPOF.

    📺 Netflix Chaos Engineering — Netflix randomly kills servers, network links, even entire AZs in production. Their system is so redundant that users don't notice. This is how they achieve 99.99% uptime.

    🏦 Banking systems — Banks have redundancy at EVERY layer: dual network links, replicated databases, backup data centers in different cities, diesel generators for power backup. A bank going down = losing millions per minute.

    📱 WhatsApp — Uses multiple data centers globally. If one data center fails, DNS routes users to another. Messages are replicated across data centers. No single server failure can take WhatsApp down.

    Common Mistakes in Interviews

    Not identifying SPOFs in your own design — You draw a design with one database and one app server. Interviewer asks "what are the SPOFs?" You should proactively identify them before being asked.

    Only thinking about servers — SPOFs can be: a software component (single Redis cache with no replica), a network link, a third-party dependency (if Stripe goes down, can you still accept orders?), or even a process (if CI/CD pipeline breaks, nobody can deploy).

    Adding redundancy without failover logic — Having 2 databases means nothing if there's no automatic failover. If the primary dies and you need a human to manually switch, you'll still have hours of downtime.

    Forgetting about "split-brain" — Two servers both think they're the primary. Both accept writes. Data diverges. This is WORSE than downtime. Discuss how failover prevents split-brain (quorum, fencing tokens).

    Not mentioning the cost trade-off — Adding redundancy everywhere is expensive. Show you can think about WHERE it matters most (critical path vs nice-to-have features).

    🎯 Interview One-Liner

    "I'd eliminate single points of failure by deploying across multiple availability zones with automated failover — redundant load balancers, database replicas with automatic promotion, and multi-region DNS — ensuring no single component failure causes system-wide downtime."

    Interview Q&A

    Q: How do you identify SPOFs in a system?

    Walk through the request path from user to response and ask "what happens if THIS component dies?" at each step. User → DNS (SPOF if single provider) → Load Balancer (SPOF if single instance) → App Server (SPOF if single) → Database (SPOF if single). Also check: network links, third-party services, deployment pipeline, and human knowledge (bus factor).

    Q: How does database failover work?

    A primary database has one or more replicas receiving real-time copies of all writes. A monitoring system checks the primary's health every few seconds. If the primary is unresponsive for X seconds, the monitor promotes a replica to primary, updates the DNS/connection string, and app servers reconnect. The whole process takes 15-60 seconds in managed services like AWS RDS. Risk: some recent writes might be lost if they hadn't replicated yet.

    Q: Active-Active vs Active-Passive — when to use each?

    Active-Active: both instances serve traffic simultaneously. Better resource utilization, but more complex (need to handle concurrent writes, data sync). Use for: app servers, CDN edges. Active-Passive: standby sits idle, takes over on failure. Simpler, no conflict issues. Use for: databases (write conflicts are hard), services where simplicity is preferred. Active-Active is a higher maturity level.

    Q: What's Netflix's Chaos Monkey approach?

    Chaos engineering: intentionally inject failures in production to verify your redundancy works. Chaos Monkey randomly kills server instances. Chaos Kong takes down an entire AWS region. If the system survives gracefully, great. If it doesn't, you found a hidden SPOF before customers did. The philosophy: "if you're not testing failure, you're hoping for the best."

    Q: How do you handle SPOF in third-party dependencies?

    (1) Multi-provider: use both Stripe AND PayPal for payments. If Stripe goes down, route to PayPal. (2) Graceful degradation: if recommendation service (third-party ML) is down, show trending items instead. (3) Caching: cache third-party responses so you can serve stale data briefly during outages. (4) Circuit breakers: if a dependency is failing, stop calling it (fail fast) instead of letting it slow down your entire system.

    Quick Quiz

    1/5

    Your system has: Users → 1 Load Balancer → 3 App Servers → 1 Database. How many SPOFs exist?