Skip to main content
← CONCEPTS / SYSTEM DESIGN & ARCHITECTURE
An end-to-end domain learning journey

Availability Patterns &
The Nines.

Design high-availability topologies using Active-Passive and Active-Active failover, and compute composite uptime budgets across series and parallel dependencies.
Start the journey2 sections
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

To keep the architecture evolvable without sacrificing reliability, series dependencies multiply failure probabilities ($A_{\text{total}} = A_1 \cdot A_2$), whereas parallel redundant components multiply unavailability ($A_{\text{total}} = 1 - (1 - A_1)(1 - A_2)$).

TL;DR30-second simplified summary
▾

Adding a single non-redundant authentication service in the critical path of a 99.99% API immediately caps your system at the weakest link. Understanding Active-Passive vs.

Series dependencies multiply failure probabilities (Atotal=A1⋅A2A_{\text{total}} = A_1 \cdot A_2), whereas parallel redundant components multiply unavailability (Atotal=1−(1−A1)(1−A2)A_{\text{total}} = 1 - (1 - A_1)(1 - A_2)).

Full walkthrough · 2 stages
01
SYSTEM DESIGN & ARCHITECTURE · STAGE 01L4 · FUNDAMENTALS

The idea & core mechanics.

Why this matters: Design high-availability topologies using Active-Passive and Active-Active failover, and compute composite uptime budgets across series and parallel dependencies.

Adding a single non-redundant authentication service in the critical path of a 99.99% API immediately caps your system at the weakest link. Understanding Active-Passive vs. Active-Active failover and series/parallel availability math is essential for hitting three-9s (8.77h/yr) or four-9s (52.6m/yr) SLO error budgets.

ChoiceWhat it buysWhat it costs
Good candidateActive-Passive (hot/warm standby) when only one writer/leader can safely hold state or licensing restricts dual-active nodes.
Good candidateActive-Active when stateless services or multi-region databases can serve traffic simultaneously across zones/regions.
Think twiceAssuming two 99.9% components in sequence give 99.9% availability—in series they drop to 99.8% (doubling downtime).

Principle 1

99.9% (Three 9s) allows 8h 45m 57s downtime/year (~43.8m/month); 99.99% (Four 9s) allows 52m 36s/year (~4.38m/month); 99.999% (Five 9s) allows 5m 15s/year.

Principle 2

Active-Passive failover uses heartbeats; if the active node stops responding, the standby promotes (RTO depends on hot vs. cold standby; async replication risks RPO > 0).

Principle 3

Active-Active spreads live traffic across multiple instances via DNS/load balancers—higher utilization and instant blast-radius isolation, but requires conflict resolution for shared writes.

Principle 4

Series formula: Aseq=∏iAiA_{\text{seq}} = \prod_i A_i; Parallel formula: Apar=1−∏i(1−Ai)A_{\text{par}} = 1 - \prod_i (1 - A_i).

02
SYSTEM DESIGN & ARCHITECTURE · STAGE 02L5 · APPLIED DESIGN

Walkthrough & implementation.

Step-by-step execution mechanics and reference implementation for Availability Patterns & The Nines.

Architecture & Trade-Off Matrix

Availability Downtime / Year Downtime / Month Downtime / Day Typical Architecture
99% (Two 9s) 3.65 days 7.30 hours 14.4 min Single-zone app + scheduled backups
99.9% (Three 9s) 8h 45m 57s 43m 50s 1m 26s Multi-AZ app + Active-Passive DB
99.99% (Four 9s) 52m 36s 4m 23s 8.6s Auto-failover Multi-AZ + circuit breakers
99.999% (Five 9s) 5m 15s 26.3s 0.86s Multi-region Active-Active + zero-downtime deploys

Reference Implementations (Python & Java)

# Series vs. Parallel availability calculator (Python)
import math

def availability_series(availabilities: list[float]) -> float:
    return math.prod(availabilities)

def availability_parallel(availabilities: list[float]) -> float:
    return 1.0 - math.prod(1.0 - a for a in availabilities)
// Series vs. Parallel availability calculator (Java)
public static double availabilitySeries(double... availabilities) {
    return Arrays.stream(availabilities).reduce(1.0, (a, b) -> a * b);
}
public static double availabilityParallel(double... availabilities) {
    double unavail = Arrays.stream(availabilities).map(a -> 1.0 - a).reduce(1.0, (a, b) -> a * b);
    return 1.0 - unavail;
}
Recommended Learning Flow