Pidoku

Archive

This learning material is in the archive. It is not currently maintained and has not been updated with the latest information, so tool versions, prices and dates may be out of date.

Embracing Risk

Module 1 Lesson 1.d 35 min Difficulty 2/5

Prerequisites 1.b

The idea in one minute#

100% reliability is the wrong target. Users cannot tell 99.99% from 100% because their own Wi-Fi, phone and ISP fail far more often than that. Each extra nine costs roughly ten times more, and reaching for 100% forbids change — and change is how a product improves.

So SRE picks a target deliberately: high enough that users are happy, low enough that the team can still ship. The gap between the target and 100% is the error budget, and it is spent on purpose — on releases, experiments and planned maintenance.

An analogy#

A car built never to break down would weigh twenty tonnes and cost as much as a house. Instead, cars are built to a reliability people are happy with, and there are roadside assistance, spare tyres and warranties for the rest. Deciding “how reliable” is a product decision, not an engineering virtue.

A picture#

flowchart LR
  subgraph COST["Cost of each extra nine"]
    direction TB
    N2["99%<br/><small>one region, manual ops</small>"] --> N3["99.9%<br/><small>redundancy, on-call, canaries</small>"]
    N3 --> N4["99.99%<br/><small>multi-zone, auto-failover, no manual steps</small>"]
    N4 --> N5["99.999%<br/><small>multi-region active-active, formal methods</small>"]
  end
  subgraph USER["What the user can perceive"]
    direction TB
    ISP["Their ISP / phone / Wi-Fi<br/><small>often ~99%–99.9%</small>"]
  end
  N4 -.->|"beyond this, users<br/>mostly cannot tell"| ISP
  class N2 io
  class N3 compute
  class N4 queue
  class N5 warn
  class ISP neutral

How it really works#

Why each nine is expensive#

To go fromtoYou typically need
99%99.9%Health checks, redundancy within a zone, someone on call, rollback
99.9%99.99%Multiple zones, automatic failover, canary releases, no manual steps in recovery, dependencies at 99.999%
99.99%99.999%Multiple regions active-active, careful data replication, extensive chaos testing, a very slow change process

The 4.3 minutes a month that 99.99% allows is less than the time to detect, page and acknowledge. At that level, people cannot be in the recovery loop.

Choosing a target: questions to ask#

  1. What do users expect, and what do they get elsewhere? A consumer photo app and a payments API are different.
  2. What does an hour of failure cost? Lost revenue, refunds, contract penalties (an SLA is a contract; keep the internal SLO tighter).
  3. Who are the users? An internal batch job can tolerate hours; a hospital paging system cannot.
  4. What are the dependencies capable of? You cannot promise more than your critical path (1.b).
  5. What has the service actually achieved? Start near historical performance, then adjust.
  6. What would it cost to be one nine better, and would anyone pay for it?

Different dimensions of risk#

Reliability is not one number. Decide per dimension:

DimensionExample targetWho cares
Availability99.9% of requests succeedEveryone
Latency99% under 300 msInteractive users
Durability99.999999999% of objects never lostStorage — usually far stricter than availability
Freshness99% of reads see data under 1 min oldDashboards, search indexes
Correctness99.99% of invoices computed correctlyFinance

Durability and correctness are usually held to a much higher standard than availability: being down for ten minutes is annoying, losing someone’s data is unforgivable.

Too reliable is a real problem#

If a service is far more reliable than its SLO, users start depending on that extra reliability without anyone agreeing to it. When it finally fails, everything built on it fails too.

Google’s lock service Chubby was so reliable that other teams stopped handling its failure. The Chubby team began deliberately taking it down — planned outages — whenever it had exceeded its SLO for the quarter, to flush out those hidden hard dependencies before a real outage did. Spending unused budget on purpose is now a standard practice.

Spending the budget#

An unspent error budget is not a success; it is a sign the target is too strict or the team is too cautious. Good ways to spend it:

  • Faster, more frequent releases.
  • Riskier experiments and migrations behind flags.
  • Planned maintenance without heroic zero-downtime engineering, when that is cheaper.
  • Chaos experiments and failover tests in production (Module 10).
  • Planned outages to expose hidden dependencies.

A worked example#

A company runs an internal reporting dashboard (used by 200 analysts, 9–6 on weekdays) and a public payments API (thousands of merchants, 24×7, contractual SLA of 99.9% with refunds).

Reporting dashboardPayments API
Users noticeAfter a few minutes, during working hoursImmediately, any time
Cost of an hour downAnnoyed analysts~$40,000 in failed transactions plus SLA credits
DependenciesOne warehouse at ~99.5%Card networks, DB, HSM at 99.95%+
History99.6% last quarter99.96% last quarter
Chosen SLO99%, business hours only99.95% (tighter than the 99.9% SLA)

The dashboard team can now say no to a second region and a 24×7 rotation. The payments team knows its 21-minute monthly budget leaves no room for manual recovery, so automated failover and canaries are justified spend.

Code#

A rough cost–benefit model for choosing a target. The numbers are illustrative; the shape is what matters — the cost curve rises steeply while the value of avoided downtime flattens out.

Go
// risk.go — compare the cost of reaching a target with the downtime it avoids.
package main

import (
	"fmt"
	"math"
)

func main() {
	const costPerHourDown = 40000.0 // revenue and credits lost per hour of full outage
	const hoursPerYear = 365 * 24.0
	// Rough yearly engineering + infrastructure cost to hold each target (rule of thumb: ~x10 per nine,
	// starting from a small team).
	targets := []struct {
		slo  float64
		cost float64
	}{
		{0.99, 150_000},
		{0.999, 450_000},
		{0.9995, 800_000},
		{0.9999, 2_000_000},
		{0.99999, 9_000_000},
	}

	fmt.Printf("%-9s %14s %14s %14s %12s\n", "SLO", "down h/year", "outage cost", "eng cost", "total")
	best, bestTotal := 0.0, math.Inf(1)
	for _, t := range targets {
		down := (1 - t.slo) * hoursPerYear
		outage := down * costPerHourDown
		total := outage + t.cost
		if total < bestTotal {
			best, bestTotal = t.slo, total
		}
		fmt.Printf("%-9s %14.1f %14.0f %14.0f %12.0f\n",
			fmt.Sprintf("%.3f%%", t.slo*100), down, outage, t.cost, total)
	}
	fmt.Printf("\ncheapest overall target: %.3f%%\n", best*100)
	fmt.Println("Change costPerHourDown to 4000 (an internal tool) and run again.")
}

With $40,000 an hour at stake, the model lands near 99.95%. For an internal tool it lands at 99%. Real decisions add things the model ignores — reputation, safety, regulation — but forcing the numbers onto the table is the point.

Remember this#

  • 100% is the wrong target: users cannot perceive it, and it forbids change.
  • Each nine costs roughly ten times more; at 99.99% humans cannot be in the recovery loop.
  • Choose per dimension — availability, latency, durability, correctness — and keep the SLO tighter than any SLA.
  • An unspent error budget is a signal; spend it on releases, experiments and planned outages.

Try it#

  1. Run risk.go with your own guess of the cost of an hour of downtime for a service you know.
  2. Write the SLO for that service along three dimensions (availability, latency, one more).
  3. Name a dependency your team relies on that has never failed. What happens when it does?

Check yourself#

  1. Why can users not tell 99.99% from 100%?
  2. What is the difference between an SLO and an SLA, and which should be tighter?
  3. Why did the Chubby team take their service down on purpose?
  4. Why is durability usually held to a stricter target than availability?

Sources#

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in