AI Hints
Home›System Design Tutorial›Up, Big and Clear
System Design · Lesson 7 of 120

Availability and the Nines

How often it is up.

⏱ 2 min read▶ Video at 7:03🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Availability is the share of time a system works. It's written as a percentage, and engineers talk about nines. Ninety nine percent is two nines. Ninety nine point nine is three nines.

Availability and the Nines
From the video: Availability and the Nines
  • Share of time it works
  • Measured in nines
  • 99.9% = three nines

What the nines allow

Each extra nine sounds tiny, but look at the downtime it allows. Run it. Two nines allows more than three and a half days of downtime a year. Three nines allows under nine hours. Four nines, under one hour. And five nines allows barely five minutes a year.

nines.pypython
for nines in [2, 3, 4, 5]:
    uptime = 1 - 10 ** -nines
    down_min = (1 - uptime) * 365 * 24 * 60
    if down_min > 24 * 60:
        text = f"{down_min / 60 / 24:.1f} days"
    elif down_min > 60:
        text = f"{down_min / 60:.1f} hours"
    else:
        text = f"{down_min:.1f} minutes"
    print(f"{uptime:.5%} up -> {text} down per year")
Output
99.00000% up -> 3.7 days down per year
99.90000% up -> 8.8 hours down per year
99.99000% up -> 52.6 minutes down per year
99.99900% up -> 5.3 minutes down per year

How to get more nines

More nines cost more money and effort. You get them by removing single points of failure, keeping spare copies of everything, detecting failures fast, and switching over automatically. We'll learn each of these later in the course.

keyvalue
No single pointnothing that takes it all down
Redundancyspare copies
Fast detectionhealth checks, alerts
Auto failoverswitch without humans

Summary

Availability is measured in nines, and each nine cuts the allowed downtime by ten. Next, the two ways to handle more users. Bigger machines, or more machines.

Key takeaways
  • 99.9% ≈ 9 hours a year
  • Each nine costs more
  • Redundancy adds nines
Next up: Vertical vs Horizontal Scaling — bigger or more