Availability, Reliability & Fault Tolerance

Keeping a system up, correct, and standing even when parts of it fail.

Availability & reliability in 30 seconds

  • Availability: fraction of time the system is up. Reliability: does the right thing over time. Fault tolerance: keeps working when parts fail.
  • The nines: 99% ≈ 3.65 days down/year, 99.9% ≈ 8.8 hours, 99.99% ≈ 52 minutes — each nine costs disproportionately.
  • SPOF: any single component whose failure kills the system — remove them with redundancy (two of everything critical).
  • Failover: heartbeats detect a dead primary, then a standby is promoted to take over.
  • Split-brain: the danger where both nodes think they're primary — fencing and one source of truth for 'who's leader' prevent it.
  • Design for failure: timeouts, retries with backoff, circuit breakers, and graceful degradation by default.

Why a plane has two engines

A passenger jet has two engines, not because it needs both to fly, but because it can fly on one. Engines fail — rarely, but they do — and the whole point of the second engine is that a failure becomes a story the pilot handles calmly instead of a catastrophe. The plane is designed on the assumption that a part will break, and it keeps flying anyway.

That's the entire mindset of availability and fault tolerance. You don't build a system hoping nothing breaks; you build it so that when something breaks — and it will — the system keeps serving. 'Two engines' shows up again and again in this page as 'two of everything critical', because redundancy is how software earns the same calm the pilot has.

The problem it solves: failure is a certainty, not a risk

At small scale, failure feels like a rare accident. At real scale it's a constant: with thousands of machines, disks, and network links, something is always failing right now. A design that assumes everything stays up is a design that's already broken — it just hasn't met a bad day yet.

So the job isn't to prevent failure (impossible) but to make the system tolerate it — to keep answering users even as individual parts die, reboot, or go unreachable. Availability, reliability, and fault tolerance are the three angles on that single job.

Availability is the fraction of time the system is up and responding. Reliability is whether it does the right thing consistently over time — a system can be available but reliably wrong. Fault tolerance is the ability to keep working when components fail. You want all three, and they're achieved by different means: redundancy for availability, correctness and testing for reliability, and graceful failure handling for fault tolerance.

Availability in numbers

Availability is usually quoted in 'nines'. Each extra nine is roughly ten times less downtime — and often far more than ten times the cost and complexity. Know what the target actually buys you before you promise it.

AvailabilityNicknameDowntime per yearDowntime per day
99%two nines~3.65 days~14 min
99.9%three nines~8.76 hours~1.4 min
99.99%four nines~52 minutes~8.6 sec
99.999%five nines~5.26 minutes~0.86 sec
Where the 'nines' come from — it's just arithmetic (python)
MINUTES_PER_YEAR = 365 * 24 * 60   # 525,600

def downtime(availability):
    allowed_down = 1 - availability          # fraction of time we may be down
    return MINUTES_PER_YEAR * allowed_down    # minutes/year of downtime

print(downtime(0.99))       # => 5256.0   min (~3.65 days)
print(downtime(0.999))      # => 525.6    min (~8.8 hours)
print(downtime(0.9999))     # => 52.56    min
print(downtime(0.99999))    # => 5.256    min
# Each extra '9' cuts the allowed downtime by 10x -
# but the engineering cost to achieve it usually grows much faster.

Why redundancy multiplies, not adds

Here's the magic behind 'two of everything'. Suppose one server is up 99% of the time — it's down 1% of the time. Put a second, independent server beside it, and the system is only down when both are down at once. The chance of that is 1% × 1% = 0.01% — so two 99% servers together reach 99.99% availability. Redundancy multiplies the small failure probabilities, which is why adding a second copy is such a huge leap.

Two independent copies: failures multiply, so availability jumps (python)
one_up = 0.99                 # a single server is up 99% of the time
one_down = 1 - one_up         # down 1% of the time

# System is down only if BOTH independent copies are down at once:
both_down = one_down * one_down       # 0.01 * 0.01 = 0.0001
pair_up = 1 - both_down               # => 0.9999  (four nines!)

# Add a third copy and the down-probability shrinks again:
three_down = one_down ** 3            # 0.000001
print(1 - three_down)                 # => 0.999999  (six nines)
# Caveat: this assumes failures are INDEPENDENT. A shared power supply,
# rack, or region breaks that assumption - which is why you spread copies out.

The caveat in that last comment matters enormously: the multiplication only holds if the copies fail independently. Two servers in the same rack share a power supply and a network switch; when that switch dies, both go together and you get no benefit. This is why redundancy is spread across racks, availability zones, and regions — you're buying independent failure, not just more boxes.

The single point of failure (SPOF)

A SPOF is any component whose failure takes the whole system down — one database, one load balancer, one region. The core move for availability is eliminating SPOFs through redundancy: run at least two of everything, so losing one doesn't lose the system. The quiet SPOF people forget is the load balancer itself, or a single shared cache the whole app depends on.

Failover: a standby takes over when the primary stops responding.

The gap redundancy alone can't fill: detecting the failure

Having a standby is only half the solution. A natural question: 'if I have a backup, aren't I safe?' Not until something notices the primary is dead and promotes the standby. A spare engine is useless if nobody flips the switch.

That noticing is the job of heartbeats — periodic 'I'm alive' signals. If the heartbeats stop, the system concludes the primary is gone and begins failover. But this is where it gets subtle, and the subtlety is where real outages are born:

  • Too slow to react — wait too long for missing heartbeats and the system is down for that whole window.
  • Too eager — react to one missed beat (maybe just a network blip) and you flap back and forth, promoting and demoting needlessly.
  • The nightmare: split-brain — the primary wasn't actually dead, just unreachable. Now the standby is promoted too, both think they're in charge, and both accept writes — silently corrupting the data.

Failover and heartbeats

Failover is the act of switching to a redundant component when the active one dies. It relies on heartbeats — periodic health signals — to detect the failure, then a promotion step to make the standby active. The subtle risks: detecting failure too slowly (long outage) or too eagerly (flapping), and the dreaded split-brain, where both nodes think they're the primary and corrupt data. Fencing and a single source of truth for 'who is leader' prevent that.

Heartbeat-driven failover (with a guard against flapping) (java)
// Watcher loop: promote the standby only after SUSTAINED silence,
// not on a single missed beat (which could be a transient blip).
int missed = 0;
while (true) {
    if (primary.heartbeatFresh()) {
        missed = 0;                       // primary is clearly alive
    } else {
        missed++;                         // one missed beat - not yet convinced
        if (missed >= FAILOVER_THRESHOLD) {   // e.g. 3 in a row
            // Fence the old primary FIRST so it cannot keep writing,
            // THEN promote - this is what prevents split-brain.
            fence(primary);
            promote(standby);
            break;
        }
    }
    sleep(HEARTBEAT_INTERVAL);
}

Designing for failure as the default

  • Redundancy — no single instance of anything critical.
  • Health checks — automatically pull dead instances out of rotation.
  • Timeouts and retries — never wait forever; retry with backoff and jitter.
  • Circuit breakers — stop hammering a failing dependency so it can recover.
  • Graceful degradation — serve stale data or disable non-critical features instead of failing entirely.
Retry with exponential backoff and jitter (java)
int attempt = 0;
while (attempt < MAX_ATTEMPTS) {
    try {
        return call(dependency);          // success: we're done
    } catch (TransientError e) {
        attempt++;
        // 100ms, 200ms, 400ms, 800ms... doubling each time
        long backoff = 100L * (1L << attempt);
        // jitter spreads retries so clients don't all retry in lockstep
        long jitter = random.nextLong(backoff);
        sleep(backoff + jitter);
    }
}
throw new GiveUpException();              // stop; let a circuit breaker take over

The gap redundancy can't fill: cascading failure

Redundancy protects you from a part dying. It does nothing — in fact it makes things worse — against a part getting slow. This is the failure mode that takes down mature, well-engineered systems, so it's worth seeing clearly.

Picture service A calling a slow service B. A's requests pile up waiting for B, so A runs out of threads and starts failing too. Now whatever calls A backs up, and the slowness spreads outward like a traffic jam — a cascading failure. The cruel twist: retries make it worse, because a struggling B now gets hit with the original load plus a flood of retries. The tools that stop this aren't more copies; they're timeouts (don't wait forever on B), circuit breakers (stop calling B when it's clearly sick), and backoff (retry gently, not in a stampede).

A circuit breaker trips open after repeated failures, giving the sick dependency room to recover.
A timeout is the simplest protection against a slow dependency (java)
// WITHOUT a timeout: if B hangs, this thread hangs forever.
// Enough hung threads and service A stops serving anyone - the jam spreads.
Response r = dependencyB.call(request);     // might never return

// WITH a timeout: give up quickly and fail THIS request,
// freeing the thread to serve others instead of locking up the whole service.
Response r = dependencyB.call(request)
    .orTimeout(200, MILLISECONDS)           // wait at most 200ms
    .exceptionally(e -> cachedFallback());  // then degrade gracefully
// Fail fast + degrade > wait forever + take everything down.

Available but wrong: why reliability is separate

It's tempting to lump reliability in with availability, but a concrete example shows why they're distinct. Imagine a payment service that always responds instantly — 100% available — but, under a subtle bug, occasionally charges the wrong amount. It's up; it's just wrong. That's a reliability failure, not an availability one, and no amount of redundancy fixes it — a second copy of buggy code is just as wrong.

Availability is bought with redundancy and failover. Reliability is bought with correctness: testing, careful handling of edge cases, idempotency so retries don't double-charge, and validation. A system you can trust needs both — being reachable is worthless if the answers it gives are wrong.

Availability is the quality the business feels most directly — and almost every resilience component (replication, load balancers, circuit breakers) exists to buy it.

Why it matters

  • Downtime is the outage everyone notices; an availability target is a real budget decision, not a vanity metric.
  • Separating availability, reliability, and fault tolerance keeps you from claiming one while quietly missing another.
  • Removing single points of failure is the single highest-leverage move you can make for uptime.

If ignored

  • One failed component — a lone database or load balancer — takes the entire system down with it.
  • A sloppy failover design hits split-brain and corrupts data while trying to stay up.
  • A flaky dependency with no timeout or circuit breaker drags the whole app down with it.

Where it fits

  • Sits at the topology level, deciding how many of each component you run and how they fail over.
  • Lives in the health-check, heartbeat, and failover machinery rather than business logic.
  • Shapes the SLOs you promise and the on-call discipline required to keep them.

Related topics

  • Replication: redundant copies are the foundation of both availability and failover
  • Load balancing: health checks pull dead instances out of rotation automatically
  • Circuit breaker: stops a failing dependency from cascading into a full outage
  • Consistency models: the availability-vs-consistency tension you weigh during partitions

Interview lens

Questions it unlocks

  • How do you make this system highly available?
  • What's your single point of failure, and how do you remove it?
  • What happens when your primary database goes down?

60-second answer

I separate availability (is it up), reliability (is it correct over time), and fault tolerance (does it survive failures). For availability I remove single points of failure with redundancy — at least two of every critical component, spread across independent failure domains — and automated failover driven by heartbeats, while guarding against split-brain with fencing. I pick an availability target by business need rather than vanity, since each extra nine costs disproportionately. And I design for failure by default: timeouts, retries with backoff, circuit breakers, and graceful degradation.

Common traps

  • Claiming high availability while leaving an obvious SPOF like the load balancer.
  • Ignoring split-brain risk in a failover design.
  • Promising five nines when the business only needs three.
  • Putting 'redundant' copies in the same rack or region so they fail together.

Search topics

↑↓ to move · Enter to open · Esc to close