Sub topic 2
Reading the nines
This chapter assumes you know what availability means as a fraction of time or requests, and that you can read short Python snippets. Here you learn the "nines" shorthand, how to read it correctly, and the mistakes people make with it.
What the notation says
Availability targets are written as percentages close to 100. Counting the nines is a quick way to say how close. The count is the number of leading 9 digits in the percentage.
| Availability | Nines | Common name |
|---|---|---|
| 90% | one | "one nine" |
| 99% | two | "two nines" |
| 99.9% | three | "three nines" |
| 99.99% | four | "four nines" |
| 99.999% | five | "five nines" |
Each added nine removes 90% of the remaining unavailability. At 99%, 1% of the time is unavailable. At 99.9%, it is 0.1%. This is a factor of ten per nine, so the scale is logarithmic. The difference between 99% and 99.9% matters far more than the difference between 90% and 91%, even though both look like small steps on a percentage scale.
You can compute the number of nines directly from the availability:
from math import log10
def nines(availability):
return -log10(1 - availability)
for a in (0.9, 0.99, 0.999, 0.9995, 0.9999):
print(f"{a:.2%} -> {nines(a):.2f} nines")
# 90.00% -> 1.00 nines
# 99.00% -> 2.00 nines
# 99.90% -> 3.00 nines
# 99.95% -> 3.30 nines
# 99.99% -> 4.00 ninesThe result is fractional for targets like 99.95%. People say "three and a half nines" for this, though 99.95% is really 3.3 nines. The shorthand is loose, so state the exact percentage whenever it matters.
Why the scale looks the way it does
Because each step divides the unavailable fraction by ten, the cost of reaching the next nine tends to rise. You need to remove ten times more of the failure causes, or recover ten times faster. A later chapter covers this cost.
Common errors when reading nines
- Rounding up the target. "Three nines" means 99.9%, not 99.99%. A request for "three nines" that is met at 99.5% has failed the target by a factor of five in downtime.
- Comparing percentages by difference. Going from 99.0% to 99.9% is a 0.9 point gain, and going from 99.9% to 99.99% is a 0.09 point gain. The second gain is smaller on paper and equally hard to achieve. Compare the unavailable fraction instead.
- Reading the nines without the period. A target such as 99.9% is meaningless until you know the window it covers. A month and a year give different amounts of allowed downtime, and a short window can be blown by a single incident.
- Ignoring what is measured. 99.9% of minutes and 99.9% of requests are different claims. A later chapter on measurement covers the difference.
Reading a target in practice
To compare two targets, convert each to its unavailable fraction and divide:
def ratio_of_downtime(a, b):
return (1 - a) / (1 - b)
print(ratio_of_downtime(0.99, 0.999)) # about 10: 99% allows 10x the downtime of 99.9%
print(ratio_of_downtime(0.999, 0.9995)) # about 2: 99.9% allows 2x the downtime of 99.95%
print(ratio_of_downtime(0.9, 0.91)) # about 1.11: a small changeThe first ratio is large and the third is small, even though the percentage gaps (0.9 and 1.0 points) look similar. This is the practical value of the notation: it shifts attention from the availability to the remainder.
The next chapter turns these fractions into minutes of downtime per day, month, and year.
Exercise
A service moves from 99.95% to 99.99% availability. By what factor does the allowed unavailable fraction shrink, and how many nines does the new target have?
Show answer
The unavailable fraction goes from 0.05% to 0.01%, so it shrinks by a factor of 5. The new target, 99.99%, has four nines.
Exercise
A team says their service has "three nines" and measures 99.5%. Do they meet the target, and by what factor does their downtime exceed the target's?
Show answer
No. Three nines is 99.9%, which allows 0.1% unavailability. At 99.5% the service is unavailable 0.5% of the time, which is 5 times the allowed amount.