system-design-primer
reference — fundamentals

Availability patterns

in short — written for this site
Two complementary patterns support high availability: fail-over and replication.
in sequence
Availability (Total) = Availability (Foo) * Availability (Bar). Two components at 99.9% give 99.8% — worse than either alone.
in parallel
Availability (Total) = 1 - (1 - Foo) * (1 - Bar). The same two components give 99.9999%, because both must fail at once.
nines
Availability is measured in nines. 99.99% is four nines: about 52 minutes of downtime a year, 8.6 seconds a day.
from the primer — full sectionsynced

There are two complementary patterns to support high availability: fail-over and replication.

Fail-over

Active-passive

With active-passive fail-over, heartbeats are sent between the active and the passive server on standby. If the heartbeat is interrupted, the passive server takes over the active's IP address and resumes service.

The length of downtime is determined by whether the passive server is already running in 'hot' standby or whether it needs to start up from 'cold' standby. Only the active server handles traffic.

Active-passive failover can also be referred to as master-slave failover.

Active-active

In active-active, both servers are managing traffic, spreading the load between them.

If the servers are public-facing, the DNS would need to know about the public IPs of both servers. If the servers are internal-facing, application logic would need to know about both servers.

Active-active failover can also be referred to as master-master failover.

Disadvantage(s): failover

  • Fail-over adds more hardware and additional complexity.
  • There is a potential for loss of data if the active system fails before any newly written data can be replicated to the passive.

Replication

Master-slave and master-master

This topic is further discussed in the Database section:

Availability in numbers

Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. Availability is generally measured in number of 9s--a service with 99.99% availability is described as having four 9s.

99.9% availability - three 9s

DurationAcceptable downtime
Downtime per year8h 45min 57s
Downtime per month43m 49.7s
Downtime per week10m 4.8s
Downtime per day1m 26.4s

99.99% availability - four 9s

DurationAcceptable downtime
Downtime per year52min 35.7s
Downtime per month4m 23s
Downtime per week1m 5s
Downtime per day8.6s

Availability in parallel vs in sequence

If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel.

In sequence

Overall availability decreases when two components with availability < 100% are in sequence:

Availability (Total) = Availability (Foo) * Availability (Bar)

If both Foo and Bar each had 99.9% availability, their total availability in sequence would be 99.8%.

In parallel

Overall availability increases when two components with availability < 100% are in parallel:

Availability (Total) = 1 - (1 - Availability (Foo)) * (1 - Availability (Bar))

If both Foo and Bar each had 99.9% availability, their total availability in parallel would be 99.9999%.

compose two components
Availability (Total) = Availability (Foo) * Availability (Bar)
total
99.8001%
2 nines
downtime
year — 17h 30m 40s
month — 1h 26m 21s
day — 2m 53s
sourcedonnemartin/system-design-primer / README.mdanchor#availability-patternssyncedsynced from donnemartin/system-design-primer@master · 2026-08-16