What it is
Availability is the degree to which a service is ready to answer correctly when asked. It is measured over a period, either as uptime (the fraction of time the service was usable) or, more usefully for request-driven systems, as the fraction of requests that succeeded. It is usually expressed in "nines": 99.9% ("three nines") or 99.99% ("four nines").
Why it exists
Hardware fails, processes crash, deployments go wrong, networks partition and whole data centres lose power. Users and businesses depend on services being there anyway: an hour of checkout downtime is lost revenue, and an unavailable authentication service takes every dependent product down with it. Availability turns "it should be up" into a number that can be promised, measured and designed for.
How it works
Downtime budgets. Each nine cuts allowed downtime tenfold:
| Target | Downtime per year | Per 30-day month |
|---|---|---|
| 99% | ~3.7 days | ~7.2 hours |
| 99.9% | ~8.8 hours | ~43 minutes |
| 99.99% | ~53 minutes | ~4.3 minutes |
| 99.999% | ~5.3 minutes | ~26 seconds |
Availability can also be described as MTBF ÷ (MTBF + MTTR): how long a component runs between failures versus how long a repair takes. You raise it by failing less often or by recovering faster, and beyond three nines mostly by recovering automatically.
Redundancy and failover. Run more than one copy of each component, put something in front that routes around failed copies (a load balancer with health checks, a database failover manager, DNS), and make sure the remaining copies can carry the load. A failure then costs only the requests in flight plus those sent during the detection window: probe interval × failures needed to eject.
Series and parallel. Components a request needs one after another multiply: three components at 99.9% give at most about 99.7%. Independent redundant copies fail only together: two 99% copies give 1 − 0.01² = 99.99%. The independence assumption is crucial; copies in the same rack, zone, or running the same bad deployment fail together.
When to use it
Set an explicit availability target for every user-facing or widely depended-upon service, and derive the architecture from it. Internal tools may be fine at 99%; a payment API or identity provider may need 99.99% and multiple zones. Write targets as service level objectives and measure them from the user's point of view.
When not to
Do not chase nines the business does not need. Each one roughly multiplies cost and complexity: multi-zone databases, multi-region traffic management, on-call rotations, chaos testing. Also, a service cannot be meaningfully more available than the things its users need anyway, such as their own network connection or a critical upstream dependency.
Trade-offs
| Choice | You gain | You pay |
|---|---|---|
| Redundant instances (N+1) | Survives one failure | Idle capacity, load balancer to run |
| Multiple zones | Survives a data-centre failure | Cross-zone latency and traffic cost |
| Multiple regions | Survives a regional outage | Data replication, consistency conflicts, much higher complexity |
| Aggressive health checks | Short detection window | Probe load, false ejections on brief hiccups |
| Deep health checks (test dependencies) | Detect broken dependencies | One shared dependency failure can eject every instance |
| Database replication with automatic failover | Survives a database host failure | Replication lag, risk of split brain, failover time |
Alternatives
Where full redundancy is too expensive, graceful degradation keeps the core working when a part fails: serve cached or default content, disable recommendations, queue writes for later. Static stability designs systems so they keep running on their last known good state when a control plane is unavailable. These do not raise uptime of the failed part, but they raise the availability users experience.
Failure modes
- Hidden single points of failure: one load balancer, one database primary without standby, one DNS provider, one configuration service, one region.
- Correlated failures: redundant copies on the same host, rack or zone, or all updated by the same bad deployment at once.
- No spare capacity: failover moves load onto survivors that are already near their limit, turning one failure into overload of all.
- Health checks that miss the problem: probes succeed while every real request fails, or the reverse.
- Slow detection or failover: minutes of errors while a failover manager decides what to do.
- Retry storms: clients retrying during an outage multiply load when the service comes back.
In production
Measure availability as successful requests over total requests at the edge, per endpoint that matters, against an SLO with an error budget. Spread instances over at least two zones, run load balancers redundantly or use managed ones, and use databases with automatic failover. Deploy gradually (canaries, rolling updates) because changes cause a large share of outages. Rehearse failures: kill instances, fail over databases and test restores, so recovery is routine rather than improvised.
Common misconceptions
- "Redundancy means no errors." Requests during the detection window and those in flight on the failed copy still fail unless clients retry safely.
- "Two servers double availability." They multiply the chance of failure, and only if failures are independent and failover is automatic.
- "Availability and reliability are the same." Availability is about being up and answering; reliability includes answering correctly and not losing data over time.
- "Five nines is the goal." The right target is the one users and the business need; beyond it, money is better spent elsewhere.
Interview angle
State the target first ("99.95% for the API"), then walk the request path and remove single points of failure one by one: balancer pair, instances across zones, replicated database with failover, maybe multi-region for the most critical paths. Do the series arithmetic out loud, mention N+1 capacity and detection time, and call out what you would degrade gracefully rather than make fully redundant.
Model assumptions
The simulation is a simplified model, not a benchmark. App servers have 6 workers and a 50 ms mean service time; one server alone can carry the 60 requests per second. The load balancer probes every 500 ms; 2 failed probes eject a server and 2 good ones restore it. Health checks see only whether a server process is up, not whether its database works. A crashed component refuses connections immediately; in-flight requests on it fail. Clients do not retry unless the challenge enables it. Arrivals are random (Poisson). Numbers show behaviour and orders of magnitude only.