Sub topic 1
Availability and What the Nines Mean
Prerequisites
Assume you know basic client-server architecture, load balancers, DNS, databases, timeouts, and health checks.
Availability is the percentage of time a service is usable. “The nines” describe this percentage over a measurement period.
| Target | Approximate downtime per year |
|---|---|
| 99% | 3 days 15 hours |
| 99.9% | 8 hours 46 minutes |
| 99.99% | 52 minutes |
Components in series all need to work, so their availabilities multiply. Components in parallel provide alternatives, so the system is unavailable only when all alternatives fail.
def series(*availabilities):
result = 1.0
for availability in availabilities:
result *= availability
return result
def parallel(*availabilities):
all_down = 1.0
for availability in availabilities:
all_down *= 1.0 - availability
return 1.0 - all_down
print(series(0.99, 0.99)) # 0.9801
print(parallel(0.99, 0.99)) # 0.9999How Systems Fail and Where Single Points of Failure Hide
A failure is any condition that prevents a component from serving correctly. Hardware can fail, software can crash, networks can disconnect, and configuration changes can break multiple instances.
A single point of failure (SPOF) is one component whose failure stops the service. Common examples include one database server, one load balancer, one power source, or one network route. A design can have several application servers and still have a SPOF in the database or deployment system.
Redundancy: Spare Capacity That Removes Single Points of Failure
Redundancy means providing multiple components that can perform the same function. Spare capacity matters because a replacement that is already overloaded is not real resilience. Keep enough capacity for the remaining components to handle expected traffic after one fails.
Fault Domains: Making Sure Copies Do Not Fail Together
A fault domain is a boundary within which failures can have a common cause. Hosts, racks, availability zones, and regions are progressively larger domains. Two replicas on one host are not independent. Place replicas across domains that match the failures you need to survive.
flowchart TD
A[Client] --> L[Load balancer]
L --> B[Zone A replica]
L --> C[Zone B replica]Active-Active, Active-Passive, and N+1 Designs
- Active-active: all instances serve traffic. This uses capacity efficiently but requires consistent state handling.
- Active-passive: one instance serves traffic while another waits. Failover is simpler, but idle capacity costs money and the standby must be tested.
- N+1: N instances handle normal load, plus one spare. The design survives one instance failure without exceeding planned capacity.
Exercise
Two independent components each have 99% availability. What is the approximate availability when they are required in series?
Show answer
99% × 99% = 98.01%.