Sub topic 1
What availability means
Prerequisites
This chapter assumes you know the following:
- Basic client-server or web service architecture: a client sends a request and a server sends a response.
- Percentages and simple multiplication of probabilities.
- Short Python snippets.
Availability in one sentence
Availability is the fraction of time, or the fraction of requests, for which a service works correctly. A service that answers 999 of every 1,000 requests correctly has an availability of 99.9%.
The word "correctly" matters. A server that responds with an error page, or takes 40 seconds to answer a simple query, is up in the sense that the process is running. Users still cannot use it. Availability counts the service as down in those cases.
Availability, reliability, and durability
These three words are often mixed up. They describe different properties.
| Term | Question it answers | Example failure |
|---|---|---|
| Availability | Can users use the service right now? | The API returns 503 errors for ten minutes. |
| Reliability | Does the service behave correctly over a period, without failing? | A bug returns wrong totals on some orders. |
| Durability | Is stored data still there and intact later? | A disk fails and the only copy of a file is lost. |
The properties are related but independent. A database can be unavailable for an hour and lose no data, so it is durable but not available. A storage system can answer every request quickly and still lose records, so it is available but not durable. Reliability is the broadest term. It covers a system doing the right thing consistently, and availability is one part of it.
The basic formula
Over a period of time, availability is:
availability = good time / total timeThe request-based version is:
availability = successful requests / total requestsBoth give a number between 0 and 1, usually written as a percentage. The chapter on measurement compares the two approaches in detail. For now, use whichever one makes the example easier to follow.
Here is a small program that applies the time-based formula to a month with 50 minutes of outage.
def availability(total_minutes, down_minutes):
return (total_minutes - down_minutes) / total_minutes
month_minutes = 30 * 24 * 60 # 43,200
print(f"{availability(month_minutes, 50):.4%}") # 99.8843%Fifty minutes of downtime in a 30-day month gives about 99.88%. That is below 99.9%, which is a common target. The later chapters on nines and downtime budgets cover how to read such targets.
What "down" means
The definition of "down" is a decision, not a fact of nature. Before you can compute availability, the team must agree on what counts as a failure. Typical choices include:
- The service returns server errors (HTTP 5xx) instead of a valid response.
- A request takes longer than a set latency threshold, such as two seconds.
- A key feature is broken while the rest of the site works.
Different definitions of "down" produce different numbers for the same incident. This is why later chapters introduce SLIs, which are carefully defined measurements of service behavior.
How the pieces fit together
The rest of this tutorial builds on the definition above. The diagram shows the order of the ideas.
First you define availability. Then you learn to state it compactly as nines and to turn it into allowed downtime. You decide how to measure it. Finally you combine those into targets and budgets that a team can act on.
Common mistakes
- Treating "the server process is running" as "the service is available."
- Reporting availability as an average over a long period, which hides short severe outages. A year at 99.95% can still contain one bad six-hour incident.
- Confusing availability with durability. Backups and replication protect data, and they do not by themselves keep a service answering requests.
- Quoting a percentage without saying how it was measured or what counted as down.
Exercise
A service handled 2,000,000 requests in a day. Of these, 1,500 returned server errors and 500 took longer than the agreed latency threshold, which the team counts as failures. What is the request-based availability?
Show answer
Failures are 1,500 + 500 = 2,000. Successful requests are 1,998,000. Availability is 1,998,000 / 2,000,000 = 0.999, or 99.9%.
Exercise
An object store answers every read request within milliseconds, but a bug silently deleted 0.1% of stored objects last month. Which property is violated: availability or durability?
Show answer
Durability. The service responds, so it is available, but stored data was lost.