system-design · intermediate
SLIs, SLOs, and Error Budgets — Measure Reliability Like a Product
Start here
Teams argue endlessly about whether the service is “stable enough” until they share numbers tied to user experience.
Three linked ideas solve that:
- Service Level Indicator (SLI) — a carefully defined measurement of success from the user’s point of view.
- Service Level Objective (SLO) — a target for that measurement over a time window (for example 99.9% over 28 days).
- Error budget — the amount of allowed failure implied by the SLO. When the budget is spent, the team prioritizes reliability over risky launches.
This lesson builds on availability and latency vs throughput. It does not require you to work as a Site Reliability Engineer (SRE) already.
What you will learn
- Define SLI, SLO, and error budget in plain English.
- Pick user-centric indicators instead of vanity CPU charts.
- Set a target and window, then compute the budget.
- Use burn rates and alerts that fire before the month is ruined.
- Work a complete checkout example with numbers.
- Connect budgets to release policy without becoming a pure freeze cult.
- Avoid averages that hide painful tails.
What you should know first
| Topic | Why |
|---|---|
| Availability | SLOs often encode availability targets |
| Reliability | Correctness and durability still matter |
| Latency vs throughput | Latency SLIs need percentiles, not only means |
| Basic metrics/logs | You will choose signals you can actually measure |
Words you need before we begin
| Term | Plain English |
|---|---|
| SLI | The metric definition: what counts as a good event. |
| SLO | The goal: SLI must stay above (or below) a threshold for a window. |
| SLA | Service Level Agreement — contractual promise, often with penalties; stricter process than internal SLOs. |
| Error budget | 100% − SLO worth of failures allowed in the window (conceptually). |
| Good event / bad event | Units you count (requests, sessions, jobs) classified by the SLI rule. |
| Time window | Rolling or calendar period for the SLO (for example 28 days). |
| Burn rate | How fast you are consuming budget relative to the plan. |
| Tail latency | Slow outliers (p95/p99) that dominate user pain. |
| Toil | Manual, repetitive ops work that scales with service size. |
Simple story: the city bus promise
A bus company publishes:
“95% of buses depart within 5 minutes of the schedule, measured over each calendar month.”
- SLI: fraction of trips that departed within 5 minutes.
- SLO: 95% for the month.
- Error budget: 5% of trips may be late. If they burn that in week one, they stop adding new routes and fix operations.
The problem without SLIs and SLOs
Opinion-based reliability
Engineering says “we were fine.” Support says “checkout is broken every Monday.” Leadership hears two stories and picks the louder one.
Metric theater
Dashboards full of CPU, memory, and request counts. None answer: did the user complete the job they came for?
Feature freeze only after disaster
Teams ship until a major outage forces a panic freeze. There is no graduated response when reliability is eroding.
SLOs create a shared dial: green budget → normal change; burning budget → slow down and harden.
Step-by-step explanation
Step 1 — Choose a user journey, not a machine
Bad SLI: “CPU < 70%.”
Users do not buy CPU headroom.
Better SLI candidates:
- Checkout success (non-5xx, money captured, order id returned)
- Login success within 2 seconds
- Video start within 3 seconds
Step 2 — Write the SLI as a fraction
Common form:
\[
\text{SLI} = \frac{\text{good events}}{\text{valid events}}
\]
You must define valid:
- Exclude client 400s caused by user typos if those are not your failure.
- Exclude load tests if they are not user traffic.
- Include timeouts that the user experienced as failure.
Among authenticated checkout attempts that passed client-side validation, the fraction that returned HTTP 2xx with an orderId within 300ms at the API edge or completed successfully under 300ms—pick one precise definition and stick to it.
For a first lesson, use:
good = response is 2xx, body containsorderId, and server duration ≤ 300ms valid = requests toPOST /checkoutthat are authenticated and not load-test tagged
Step 3 — Set an SLO with a window
Examples:
- 99.9% good events over a rolling 28 days
- 99% of jobs complete within 5 minutes over calendar month
Step 4 — Compute the error budget
If SLO = 99.9% over 28 days and you expect 2,000,000 valid checkouts:
- Allowed bad events ≈ \(0.001 \times 2{,}000{,}000 = 2{,}000\)
Step 5 — Alert on burn, not only on “SLO failed at month end”
If you only page when the 28-day SLO is already breached, you learn too late.
Burn alerts ask: at the current failure rate, will we exhaust the budget too quickly?
Simple intuition: a one-hour outage that spends a huge fraction of monthly budget should page immediately, even if the 28-day number still looks “okay” for a few days.
Step 6 — Attach a policy to the budget
Examples of policy (customize to culture):
| Budget state | Change policy |
|---|---|
| Healthy (>50% remaining, not fast-burning) | Normal releases |
| Warm | Extra review on risky changes; prefer smaller batches |
| Exhausted / fast burn | Reliability work prioritised; freeze non-essential launches |
This is not punishment. It is explicit product prioritisation.
Step 7 — Separate SLOs from SLAs
- SLO: internal target guiding engineering.
- SLA: legal/customer contract, often looser than internal SLO so you have margin.
Visual mental model
flowchart TB
U[User journeys] --> SLI[SLI definitions]
SLI --> SLO[SLO targets + windows]
SLO --> EB[Error budget]
EB --> Policy[Release and priority policy]
Policy --> Work[Features vs reliability work]
Work --> U
SLI --> Alert[Burn alerts]
Alert --> Policy
Learning question: If the budget is empty, what should happen to a non-critical redesign launch?
Caption: SLIs measure; SLOs target; budgets decide pace.
Complete worked example: notes app sync API
Starting situation
A notes app sync API (POST /sync) must feel reliable for freelancers who write during client meetings.
Product promise (marketing, not yet engineering): “your notes are basically always available.”
Constraints
- ~5,000,000 valid sync requests per 28-day window
- Team of 8 engineers shipping weekly
- Dependencies: auth service, primary database
- Cannot afford full freeze every week
Decisions
| Item | Choice |
|---|---|
| SLI | Fraction of valid POST /sync that return 2xx within 500ms |
| SLO | 99.9% over rolling 28 days |
| Budget | 0.1% × 5e6 = 5,000 bad events allowed |
| Fast-burn alert | Page if budget burn implies exhaustion in < 2 days |
| Slow-burn alert | Ticket if projected to exhaust within the window |
| Policy | If budget < 20% remaining, only security + reliability + already-in-flight launches |
Execution notes
- Instrument SLI at the edge with consistent labels (
valid=true/false). - Build a dashboard: current SLI, budget remaining, recent burn.
- Run a game day: kill a DB replica; confirm burn alert fires.
- Write the policy in the team handbook so product managers see it before quarter planning.
Failure behavior
A bad deploy causes 2% failure for 30 minutes at peak (high QPS). Budget spent in that half hour may equal days of normal noise. Policy: rollback first, then post-incident, then reliability tasks before the next feature train.
Outcome
The team ships fewer “optional” migrations during warm budget weeks and stops arguing from anecdote. Limitations: the SLI ignores client bugs and offline mobile queues—those need separate product metrics.
How it works in production
Ownership
- Service owner defines SLIs/SLOs with product.
- Platform/SRE often helps with measurement pipelines and multi-window burn alerts.
- On-call responds to burn pages with rollback/mitigation runbooks.
Good operations
- SLI event pipelines that survive partial dashboard outages
- Multi-window burn alerts (short window + long window)
- Error budget reports in weekly ops review
- Capacity and load-shedding plans when latency SLIs degrade under load
- Production readiness reviews that ask “what is the SLI for this new path?”
Anti-patterns
- 20 SLOs nobody reads
- SLOs on internal queue depth with no user mapping
- Paging on raw CPU
- Setting 99.99% because it “sounds enterprise” without staffing
Failure modes
| Mode | What goes wrong | Mitigation |
|---|---|---|
| Wrong SLI | Optimising a metric users do not feel | Map SLI to a journey test |
| Average latency SLI | Hides p99 pain | Use threshold success or percentile objectives carefully |
| Too many SLOs | Alert fatigue, no action | Start with 1–3 critical journeys |
| No policy | Numbers without decisions | Write budget → action table |
| Gaming the SLI | Excluding failures until green | Transparent valid-event rules; audit excludes |
| Month-end only review | Learning after users suffered | Burn alerts during the window |
Trade-offs
| Choice | Benefit | Cost |
|---|---|---|
| Stricter SLO | Higher user trust | More engineering cost, slower feature pace |
| Looser SLO | Faster iteration | More visible failures |
| Many fine-grained SLIs | Diagnostic power | Complexity |
| Single golden SLI | Clarity | May miss secondary journeys |
| Hard freeze on budget empty | Protects reliability | Can block critical business needs if policy is naive |
Compare with related concepts
| Concept | Relationship |
|---|---|
| Availability | Often expressed as an SLO on successful responses |
| SLA | External contract; usually looser than internal SLO |
| APM dashboards | Tools; SLOs are the product agreement |
| Error budgets vs incident severity | Severity triages now; budgets manage chronic risk over time |
Common misunderstandings
- “SLO means zero downtime.”
- “We have metrics, so we have SLOs.”
- “Burning budget means people failed.”
- “99.99% is always better.”
- “Latency averages are fine.”
Check your understanding
- Define SLI, SLO, and error budget without acronyms.
- Why is “CPU low” a weak SLI for checkout?
- If SLO is 99.9% and you have 1,000,000 valid events, roughly how many failures are budgeted?
- What is a burn alert for?
- How does an SLA differ from an SLO?
Practice
- Write an SLI for “user can open their most recent note.”
- Pick 99% vs 99.9% for a hobby blog vs a payments API; justify.
- Draft a three-row budget policy table for your team.
- Given 10,000 bad events allowed and an incident that caused 4,000, what conversations should happen next week?
- Critique this SLO: “Average latency under 200ms.”
Revision summary
- SLI measures user-visible success.
- SLO sets a target over a window.
- Error budget is the allowed failure implied by the SLO.
- Alert on budget burn, not only final breach.
- Tie budgets to change policy with product agreement.
- Prefer a few journey-based SLIs over metric sprawl.
Glossary
| Term | Definition |
|---|---|
| SLI | Quantitative measure of one aspect of service level. |
| SLO | Target value or range for an SLI over time. |
| Error budget | Allowed unreliability derived from the SLO. |
| Burn rate | Speed of budget consumption versus budgeted pace. |
| SLA | Customer-facing agreement, often commercial. |
Abbreviations and terminology
- SLI — Service Level Indicator
- SLO — Service Level Objective
- SLA — Service Level Agreement
- SRE — Site Reliability Engineering
- p95 / p99 — 95th / 99th percentile
What to learn next
- Availability — nines and downtime math.
- Observability and DORA — signals and delivery metrics.
- Incident command — when burn becomes an incident.
- Production readiness reviews — ship gates.
- Tail latency and load shedding — protect SLIs under load.
FAQ from first-time learners
Q: Who sets the SLO number?
A: Product and engineering together. Engineering explains cost; product explains user need.
Q: Do internal tools need SLOs?
A: If people depend on them to ship, yes—often looser than customer-facing paths.
Q: What if dependencies cannot support our SLO?
A: Your SLO cannot exceed what dependencies realistically allow without isolation, caching, or graceful degradation. Design or renegotiate.
Track: Reliability and Operations
Series: Reliability & SRE Practice
- Availability — Nines, Error Budgets, and Redundancy
- SLIs, SLOs, and Error Budgets — Measure Reliability Like a Product (this guide)
- Capacity Planning for Backend Services
- Tail Latency and Load Shedding — Surviving Peak Traffic Overload
- Production-Readiness Reviews (PRRs)
- Incident Command for Backend Teams
By Shubham Jain