CMD Guide
HomeSystem DesignAPI Gateway

Fault Tolerance vs High Availability

Both strategies fight the same enemy — a component failure becoming a user-visible outage — but with opposite mechanisms: fault tolerance (FT) runs redundant components in lockstep so a surviving copy carries the in-flight request the instant a peer dies (the failure is masked, not recovered from), while high availability (HA) accepts a brief interruption and shrinks it by detecting the failure fast and failing over to a standby. FT spends money to make the gap invisible; HA spends money to make the gap short.

This distinction is where two absolutes commonly stated about FT break down and must be corrected. Real fault-tolerant systems do not guarantee "zero downtime, ever" and do not guarantee "no data loss ever" — they bound both quantities for a class of faults. A single independent hardware fault can be masked in well under a second; a correlated fault (the same software bug crashing both replicas, a bad deploy, an entire AZ losing power) defeats lockstep. And "no data loss" is a property of synchronous replication (RPO = 0), not of FT in general — an asynchronously replicated "fault tolerant" setup loses whatever was in the replication lag window.

diagram
diagram

How each mechanism actually works

Fault tolerance — masking. Two (or more) replicas execute the same instruction stream and stay bit-for-bit identical. VMware vSphere FT and Stratus ftServer do this in hardware lockstep; a synchronous state-machine-replicated database (Raft/Paxos with synchronous commit) does it in software. When one replica faults, the other is already at the exact same state, so it keeps answering with no re-computation. The cost is structural: you run N copies doing identical work, and every write must be confirmed by the peer before it commits, which adds latency to the hot path. FT masks independent faults; it cannot mask a fault whose cause is shared by all replicas.

High availability — fast recovery. One node serves; one or more standbys wait, kept warm by replication. A failure detector (heartbeats) notices the primary is gone, a promotion step makes a standby the new primary, and traffic is redirected (VIP move, DNS, or a connection pool re-pointing). During that window the service is unavailable and any in-flight requests fail — clients must retry. HA is dramatically cheaper because standbys don't do redundant work in lockstep and writes don't pay a synchronous cross-node round trip (if replication is async), but you accept a measurable RTO (recovery time) and, with async replication, a non-zero RPO (data loss).

Worked example 1 — the nines, in real time

Availability targets are quoted as "nines." Convert the percentage into an annual downtime budget (one year = 525,600 minutes):

TargetDowntime / yearDowntime / day
99% (two nines)3.65 days14.4 min
99.9% (three nines)8.77 hours1.44 min
99.99% (four nines)52.6 min8.6 s
99.999% (five nines)5.26 min0.86 s

Now spend the budget. Suppose your HA cluster fails over 4 times a year and each failover takes the 12 s traced below: 4 × 12 s = 48 s of outage → comfortably inside the 5.26 min five-nines budget. But if a subtle bug makes detection take 60 s and you failover 10 times a year: 10 × 60 s = 600 s = 10 min → you blow five nines and even four nines (52.6 min) is now at risk if a couple of failovers stall. The lesson: with HA, your annual downtime is (failover count) × (failover duration) — and availability is 1 minus that over the year. Both factors are engineering variables, and detection time usually dominates the duration.

Worked example 2 — trace one HA failover (the 12-second gap)

A primary Postgres (or an API-gateway upstream) crashes at t = 0. A typical managed-failover timeline:

tEventCumulative outage
0.0 sPrimary crashes; in-flight requests start failing / timing out.0 s
0–3 sHeartbeat every 1 s; 3 consecutive misses required to declare it dead (avoids false positives on a GC pause).3 s
3–5 sOrchestrator / consensus group confirms and elects a standby as new primary.5 s
5–10 sStandby is promoted; VIP / DNS / connection pool re-pointed to it.10 s
10–12 sClients reconnect and retry the failed requests (idempotent ones succeed).12 s

RTO ≈ 12 s. Now the data question. If replication was synchronous, every committed write was already on the standby → RPO = 0, no data loss, but every commit on the primary had paid a cross-node round trip (e.g. same-region cross-AZ ≈ 1–2 ms added per commit). If replication was asynchronous with, say, 5 s of lag at crash time → RPO ≈ 5 s of writes are gone. This is exactly why "FT guarantees no data loss" is wrong as an absolute: the guarantee comes from synchronous replication, and you pay for it in write latency.

Side-by-side

DimensionFault ToleranceHigh Availability
ObjectiveMask the failure — no visible interruption for a single faultMinimize downtime — recover fast after a failure
MechanismLockstep / synchronous redundant components doing identical workStandby + failure detection + failover + client retry
User-visible downtimeSub-second for covered faults; not literally zero, and no coverage for correlated faultsSeconds to minutes (the RTO); brief blips accepted
Data loss (RPO)0 only with synchronous replication0 if synchronous; equals replication lag if async
Cost & complexityHigh — 2x+ hardware, synchronous write path, lockstep coordinationModerate — standbys, health checks, orchestration
Typical homeFlight control, medical devices, payment authorization core, telecom switchesE-commerce, SaaS APIs, web platforms, most cloud services

Pitfalls

When to use which — and the trade-off

Reach for true fault tolerance when a single failed request is itself catastrophic and cannot simply be retried: a flight-control loop, an infusion pump, a telecom voice switch mid-call, the innermost ledger commit of a payment. Signals: human safety or irreversible money is on the line per operation; the operation is not naturally retryable; and you can afford 2x+ hardware plus the synchronous write-latency tax on every commit.

Reach for high availability — the right default for almost all web-scale systems — when a short, rare blip is tolerable because clients (or a queue) can retry: e-commerce checkout, SaaS APIs, an API gateway fleet. Signals: requests are idempotent or can be made so; users tolerate a 10–30 s reconnect a few times a year; budget matters.

The trade-off vs the named alternative. Choosing FT over HA buys you a sub-second, invisible gap — but it costs you: double the compute doing redundant work, added commit latency from the synchronous write path, and far more coordination complexity — and it still doesn't cover correlated faults, which are the failures that actually cause most real outages. Choosing HA over FT saves that money and latency and keeps the architecture simpler — but it costs you a measurable RTO (seconds of downtime) and, unless you pay for synchronous replication, a non-zero RPO. Crisply: choose FT when a single operation failing is unacceptable and unrepeatable; prefer HA when a brief, retryable interruption is acceptable — which is why the pragmatic pattern is HA everywhere, with synchronous replication (RPO = 0) reserved for the narrow slice of state where losing even one committed write is not allowed. Most systems marketed as "fault tolerant" in the cloud are, precisely, HA + redundancy.

Takeaways


Re-authored and deepened for this guide. Nines-to-downtime figures and failover reasoning follow Google's Site Reliability Engineering (availability tables, error budgets). Replication, RPO/RTO, leader election, synchronous vs asynchronous replication and split-brain draw on Martin Kleppmann, Designing Data-Intensive Applications (ch. 5–9). Lockstep fault tolerance references VMware vSphere Fault Tolerance and Stratus ftServer documentation; the HA-first, redundancy-end-to-end guidance aligns with the AWS Well-Architected Reliability Pillar. The original page's absolutes ("no downtime even during failure," "no data loss") were corrected to reflect real failover windows and RPO > 0.

🤖 Don't fully get this? Learn it with Claude

Stuck on Fault Tolerance vs High Availability? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Fault Tolerance vs High Availability** (System Design) and want to truly understand it. Explain Fault Tolerance vs High Availability from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Fault Tolerance vs High Availability** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Fault Tolerance vs High Availability** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Fault Tolerance vs High Availability** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes