Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 2 of 6 · Concept · 20 min · revision 1

Redundancy, failover and hidden single points of failure

Choose between active-passive and active-active, break failover time into detection, decision, promotion, redirection and warm-up, see with a seeded simulation why a lower detection threshold is not free, and find the shared parts, such as DNS, configuration, certificates, identity and control planes, that make redundant copies fail together.

Contentsand lesson path

What you will learn

  • Design redundancy and failover (active-passive, active-active, multi-zone, multi-region, deployment stamps) and remove single points of failure, including DNS and control-plane dependencies.

01. Why it matters

Imagine a booking service with two of everything: two application servers per zone, a database primary with a standby in another zone, and a second region ready to take over. One morning every request fails in both regions at once. The cause is a TLS certificate: both regions served the same one, renewed by hand a year earlier, and it expired at 09:00.

Redundancy protects you from copies failing independently. It does nothing for a failure of something the copies share. In the previous lesson the shared part was a line in a formula; here it is a design problem. This lesson asks three questions: which redundancy shape fits a component, how long failover really takes, and where the shared parts hide.

02. Active-passive and active-active

Start with the honest baseline: one copy, restarted fast. For an internal tool with a 99.5% target (about 3.6 hours a month), a single virtual machine that restarts itself and a tested restore can meet the target at a fraction of the cost and complexity of redundancy. It stops working when the machine fails more often, or takes longer to replace, than the budget allows. That is when you add copies, in one of two shapes.

Active-passive: one copy serves; a standby takes over after a failover. The standby can be cold (must be started), warm (running, not serving) or hot (ready at full size). This shape suits components with one writer, such as a database primary, because only one copy accepts changes at a time. Its costs are idle capacity, the failover delay, and a standby path that rarely runs, so it can drift out of date unnoticed.

Active-active: every copy serves; losing one shifts its share to the others with no promotion step. This fits stateless tiers behind a load balancer. Two conditions matter. Each copy needs headroom: with two copies, each must run below half of its capacity, or the survivor overloads. And if the copies write shared state, you need partitioning or conflict handling, the topic of the next lesson.

Active-passive also has a classic trap. If the standby is promoted while the old primary is only unreachable, not dead, both may accept writes: split brain. The failover must make sure the old primary can no longer write: wait for its lease to expire, use a fencing token that storage checks, or require a majority quorum. Leaders, replicas and failover shows promotion in a database; distributed systems fundamentals covers leases and quorums.

03. How long failover really takes

The parallel formula from lesson 1 assumes instant failover. In practice failover has five parts, and each one is a number you can measure in a drill:

The parts of one failover (durations depend on your system)
primary fails
|-- detect ---|-- decide --|-- promote --|-- redirect --|-- warm up --|
  missed        fence the     standby       DNS TTL,        cold caches,
  heartbeats    old primary,  replays its   connection      first queries
  or checks     wait for a    log, starts   pools, client   slow
                lease to end  accepting     caches
                              writes
                                                   service fully normal -->|

Redirection is often the longest part: clients that cache DNS answers or hold open connections keep talking to the old address until the record's TTL (time to live: how long a cached answer may be reused) ends or the connection breaks (Global load balancing with DNS and anycast estimates this). Detection is the part teams tune first, and the one with a hidden price. The simulation below assumes a primary that sends a heartbeat every second and sometimes stalls harmlessly, for example in a garbage-collection pause. A stall longer than the threshold looks exactly like a crash, so it triggers a failover that costs 30 seconds of errors.

Python 3.12 · heartbeat.py
"""Failover detection: a lower miss threshold detects crashes sooner but turns
more harmless stalls (GC pauses, network blips) into needless failovers."""
import random

rng = random.Random(7)
INTERVAL = 1.0  # seconds between heartbeats
DAYS = 30
FAILOVER = 30.0  # seconds of errors while a replica is promoted and clients reconnect
# Assumed stall model: 30 stalls a day, heavy-tailed (most short, a few long).
stalls = [0.25 * rng.paretovariate(2.0) for _ in range(DAYS * 30)]
print(f"{len(stalls)} stalls in {DAYS} days, longest {max(stalls):.1f} (seconds)")


def error_minutes(crashes, detect, false_failovers):
    return (crashes * (detect + FAILOVER) + false_failovers * FAILOVER) / 60


print(f"\n{'misses':>6}{'detect(s)':>10}{'false':>7}"
      f"{'min, 1 crash':>14}{'min, 20 crashes':>17}")
for misses in (2, 3, 4, 6, 10):
    threshold = misses * INTERVAL
    false_failovers = sum(1 for s in stalls if s >= threshold)
    detect = threshold + INTERVAL / 2  # a crash lands mid-interval on average
    one = error_minutes(1, detect, false_failovers)
    twenty = error_minutes(20, detect, false_failovers)
    print(f"{misses:>6}{detect:>10.1f}{false_failovers:>7}{one:>14.2f}{twenty:>17.2f}")
Expected output (python3 heartbeat.py)
900 stalls in 30 days, longest 7.2 (seconds)

misses detect(s)  false  min, 1 crash  min, 20 crashes
     2       2.5     13          7.04            17.33
     3       3.5      5          3.06            13.67
     4       4.5      3          2.08            13.00
     6       6.5      1          1.11            12.67
    10      10.5      0          0.68            13.50

Going from 10 missed heartbeats to 2 detects a crash 8 seconds sooner, but turns 13 harmless stalls a month into failovers. With one real crash a month, every lower threshold costs more error minutes than it saves. If you change the crash rate to 20 a month, faster detection starts to pay, and the best threshold moves lower, to 6 in this run. The right setting depends on how your real crashes compare with your harmless stalls, so measure both before tuning. Each false failover also carries split-brain risk, which no minute count shows.

Heartbeats have a blind spot too. They prove a process is alive, not that it serves requests correctly: a node with a failing disk can answer every heartbeat while timing out real queries. Detection that checks the real request path, such as the error rate of actual calls, catches much of what heartbeats miss.

04. Hidden single points of failure

A single point of failure (SPOF) is a part whose failure stops the service. The obvious ones, a lone database or cache, show up on the diagram. The hidden ones are shared by copies that look independent, so they cause common-mode failures: every copy fails for the same reason at the same moment.

  • DNS. One provider, one hosted zone, or records with long TTLs can make healthy regions unreachable.
  • Configuration and feature flags. One push can reach every region within seconds. Roll configuration out in stages like code, and let nodes keep their last known good copy (distributed configuration).
  • Certificates and keys. One certificate on every load balancer expires everywhere at once. Automate renewal, alert well before expiry, and stagger renewals across regions (TLS and PKI).
  • Identity and secrets. If every region signs users in, or fetches secrets at startup, through one service in one region, that region is a SPOF for all of them.
  • Shared control planes. The data plane does the daily work, such as serving requests and routing packets; the control plane makes changes, such as creating servers or editing DNS records. AWS documents that some global services, including IAM and Route 53, run their control plane in a single region while the data plane is spread out, and advises keeping control-plane operations out of recovery paths. The same applies to a Kubernetes API server or a CI/CD system your failover needs. The remedy is static stability: capacity already running, and failover through data-plane mechanisms such as health-checked DNS records.
  • The same software everywhere. A faulty release, a bad input that crashes every copy, or a shared account quota hits all copies together.

A public example shows how far a shared part can reach. Meta's engineering post on its 4 October 2021 outage explains that a maintenance command took down the connections in its backbone network. Its DNS servers were designed to withdraw their BGP route announcements (BGP is the protocol networks use to tell each other which addresses they can reach) when they could not reach the data centres, a sensible health rule for one site, so the whole internet lost the route to them even though they were still running. The same loss of DNS also broke many internal tools engineers would have used to recover.

To find hidden SPOFs, list what must work for two paths: the request path and the recovery path. For each item ask: if this is down, which copies fail together? Then test the answer, for example in a game day that switches off one region and checks whether the other can still sign users in, read its secrets and change its DNS.

05. When redundancy is the wrong answer

Every copy and every failover mechanism is new code that can fail. False failovers, split brain and failover bugs are outages that a simpler system would not have. Skip or postpone redundancy when the budget is generous (a 99% internal report tolerates hours of repair), when the work can simply be rerun later (a nightly batch job), or when the team cannot test the failover path regularly; an untested failover is a guess. For whole-region failover, the AWS disaster recovery whitepaper advises caution with automatic triggering because false alarms cost availability and data, and notes that many teams start failover by hand while automating every step behind the button.

06. Check your understanding

Practice check · 3 questions

Failover and shared causes

Predict or diagnose before you choose.

Q1. A database primary sends a heartbeat every second, and the standby takes over after 5 missed heartbeats. To speed up failover, the team lowers this to 2. The primary often has garbage-collection pauses of 2 to 3 seconds. What do you predict?
Q2. In a game day you block all traffic to region A. Region B's servers, database replica and load balancer pass their health checks, and users are routed to B, but none of them can sign in. Which design flaw best explains this?
Q3. In a year, a two-region service had three full outages: a bad configuration push, an expired shared certificate and a faulty release. Each one hit both regions at the same moment. Which change would have prevented the most of them?
Practice only: not graded, not saved, not evidence.

07. Apply it

For the checkout journey of the skill project:

  1. Choose active-passive or active-active for each of the five dependencies and say why, including where split brain could occur and what fences it.
  2. Estimate the failover time of the weakest component part by part, with an assumption for each part.
  3. List what the request path and the recovery path need: DNS, certificates, identity, secrets, configuration, control-plane calls. Mark each item that both regions or zones share.
  4. Pick the shared item with the widest reach, inject its failure on paper, and write down which copies fail together and what you would change.

08. Review prompt

Without looking back: when is active-passive a better fit than active-active, and what must happen to the old primary during failover? Name the five parts of failover time and explain why lowering the detection threshold is not free. Then name four kinds of hidden single point of failure and, for each, one change that keeps it from failing every copy at once.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check