← Math
Math

Availability and failure probability

Will more app servers get checkout to 99.9%?

Model required dependencies and replica groups before deciding which reliability change can meet a target.

Outcome

Multiply required parts, compute a replica group as 1 − (1 − r)ⁿ, turn availability into minutes against a target, and find the path’s ceiling.

Terminology (6)Terms used in this lesson

Term on the front, definition on the back. Paste with tabs between fields and a new line between cards, or import the download in Anki as Basic.

Availability
The fraction of a window in which a part was healthy, by a stated health rule.
Series dependency
A part the request needs. With independent required parts, multiply their availabilities.
Replica group
n interchangeable instances, any one of which suffices: 1 − (1 − r)ⁿ if they fail independently.
Downtime budget
The minutes a target allows: (1 − target) × minutes in the window. 99.9% over 30 days is 43.2 minutes.
Ceiling
The best the path can do if every replica group were perfect, limited by its single parts.
Correlated failure
Failures with a shared cause, such as a zone outage or a bad deploy, that take several replicas down together.

Why this matters

Availability targets drive on-call load, contracts and architecture budgets. The usual fix for a missed target is more replicas, but replicas only help the parts they replicate. The arithmetic shows which part limits the path before anyone buys hardware, and it also shows where its own assumption, independent failures, is too generous.

This lesson assumes probabilities of independent events from earlier lessons.

How a path’s availability is built

Availability here is the probability that a component can serve under a specified health rule and time window. A request path may require several components together, while a replicated tier may need only one working instance.

Independent required components combine by multiplying their up probabilities. For independent alternatives, multiply the probabilities that all are down and take the complement. A shared failure can break independence, and improving one tier leaves the other required dependencies in the path.

01Required parts multiply

Required parts multiply

Checkout misses its 99.9% monthly target, and the proposal is to add app servers. The app tier already has three. Even a perfect app tier leaves the path down 69 minutes a month, because the database and the payment API are single dependencies that replicas do not touch.

A checkout request needs the load balancer, an app server, the database and the payment API. Use model up probabilities 0.9999, 0.99, 0.9995 and 0.999, with the same time window and health rule. Assume all required parts are independent; their individual observed fractions alone would not establish that. Predict the three lines this program prints.

main.ts
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
// Load balancer, app tier, database, payment API: all required
const parts = [0.9999, 0.99, 0.9995, 0.999];

const path = parts.reduce((product, r) => product * r, 1);

console.log(path.toFixed(6));
console.log(Math.min(...parts).toFixed(6)); // the weakest part alone
console.log((1 - 0.01 ** 3).toFixed(6)); // three app instances, any one suffices
Why is the path below the weakest part’s 0.99?

02Any one of n

Any one of n

With three app servers and any one enough, the tier is down only when all three are down at once: 0.01³ = 10⁻⁶ if they fail independently, so the tier is up 0.999999 of the time. Writing 0.99³ = 0.970 treats the replicas as if all three were required, which makes adding servers look harmful.

(1 - r) ** n raises a number to an integer power; 0.01 ** 3 is 1.0000000000000002e-6, close enough for availability but a reminder that decimals are not exact.

03Minutes against a target

Minutes against a target

Minutes down per 30 days (43,200 minutes)
PathAvailabilityMinutes down
One app server0.98842500
Three app servers0.9984069.1
Perfect app tier (ceiling)0.9984069.1
99.9% target0.9990043.2

04The ceiling

The ceiling

Three app servers already make the tier almost perfect, so a fourth changes nothing visible. With every replica group treated as perfect, the path is 0.9999 × 0.9995 × 0.999: about 69 minutes down a month, still above the 43.2 the target allows. The load balancer, database and payment API all remain required. Perfecting the database alone leaves 0.9999×0.999=0.9989001, still short of 99.9%. Perfecting the payment path leaves 0.9999×0.9995=0.99940005 before the almost-perfect app factor, which can meet the model target. A fallback must improve that path without introducing equally limiting shared failures.

Which change can bring the path under 43.2 minutes?

05When failures are not independent

When failures are not independent

06Check the checkout path

Check the checkout path

The checkout report first needs the probability that all required parts are up. It then needs each replica group treated as alternatives. The budget request asks a harder architectural question: after removing every improvable replica group’s downtime, do the fixed single dependencies still miss the target?

In the frontend A downtime budget widget in Next.js and Svelte Optional

A status page turns the availability target into the minutes it allows this month and shows how many are left, which is easier to act on than a percentage with three nines.

Estimate.tsx
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
// Turn an availability target into the minutes it allows this month, and show what is left.
export function DowntimeBudget({
  target,
  minutesDown,
  days
}: {
  target: number;
  minutesDown: number;
  days: number;
}) {
  const allowed = (1 - target) * days * 24 * 60;
  const left = allowed - minutesDown;

  return (
    <p>
      {(target * 100).toFixed(2)}% over {days} days allows {allowed.toFixed(1)} minutes
      down;{" "}
      {left >= 0
        ? `${left.toFixed(1)} minutes left`
        : `${(-left).toFixed(1)} minutes over`}
      .
    </p>
  );
}

Check this idea later
Two replicas in the same zone each have 99% availability. Is the pair 99.99% available?
How many minutes does 99.95% allow in a 30-day month?
Sources

Values above were computed in Node 22 and run in Go 1.27, Rust 1.99 and Apple clang 17. The checkout path is a worked model.

Report a problem in this lesson

For typos, mistakes and things that don’t work. We read every report and fix what’s wrong, but we don’t reply here, so a question won’t get an answer.