Skip to main content

SLI / SLO / SLA Hierarchy

Level 7: Level 7: Reliability, Resilience & Operationsmedium30 minslislosla

SLI is good/valid events, SLO adds a target and window (99.9% over 28 days), SLA is the external promise with penalties; the measurement point (LB vs server vs client) changes the number, and latency SLOs use percentiles because averages hide the tail.

Turning "reliable enough" into a number

"Reliable enough" is not a target you can enforce. The SLI/SLO/SLA hierarchy is how you turn it into a number a dashboard computes and a policy acts on.

An SLI (Service Level Indicator) is a measured ratio: good events divided by valid events, expressed as a percentage. Availability SLI = (successful requests) / (valid requests). Latency SLI = (requests served faster than 300 ms) / (valid requests). The discipline is defining "good" and "valid" precisely. Good might mean HTTP status not in 5xx and served under a threshold. Valid deliberately excludes noise you should not be graded on: health-check pings, requests from a client that sent a malformed body (a 400 is the client's fault, not an outage), traffic during an announced maintenance window.

An SLO (Service Level Objective) is an SLI plus a target plus a window: "99.9% of valid requests succeed, measured over a rolling 28 days." The window matters. A rolling 28-day window smooths out one bad afternoon; a calendar-month window resets your budget on the 1st. Rolling windows are usually preferred because they do not give you a "free" reset that hides a chronic problem.

An SLA (Service Level Agreement) is the external, contractual version with teeth: financial penalties (service credits) if you miss it. You always set the internal SLO stricter than the SLA, so your own alerting fires before you owe customers money.

Where you measure changes the number

The same request looks different at three points. At the load balancer you capture what most users experience but miss failures that never reached the LB (DNS, a dead region). At the server you get clean internal numbers but hide network loss and the LB's own errors, flattering yourself. At the client (real-user monitoring) you capture the true end-to-end experience including the last mile, but the data is noisy and attributes the user's flaky wifi to you. Good practice: measure availability at the load balancer (the boundary you own and control) and latency with client RUM plus server-side, and state your measurement point when you quote a number.

Use percentiles, not averages, for latency

An average hides the tail. If 99 requests take 50 ms and one takes 5 seconds, the mean is ~100 ms, which looks fine while one user in a hundred is furious. p99 = 5 s tells the truth. SLOs are set on p95/p99/p99.9 depending on how much the tail matters. Averages are actively misleading for latency and you should say so.

Interview nuance: the strongest answers keep the SLO count small and tie each to a user journey. "99.9% of checkout submissions succeed over 28 days" is a good SLO because a human cares about that event. "CPU under 80%" is not an SLO, it is a resource metric with no user in it. Few SLOs, each anchored to a journey, targets set from what users actually expect (nobody notices 200 ms vs 250 ms, everybody notices 3 s).

Recap: SLI is good/valid events, SLO adds a target and window (99.9% over 28 days), SLA is the external promise with penalties; the measurement point (LB vs server vs client) changes the number, and latency SLOs use percentiles because averages hide the tail.

Apply

Your turn

The task this lesson builds to.

Define 3 SLIs and their SLO targets and measurement windows for a photo-upload API, and specify exactly how each SLI is computed from telemetry.

Think about

  1. How is an SLI defined as good events over valid events?
  2. Why does the measurement point (LB vs client vs server) change the number?
  3. Why use percentiles, not averages, for latency SLIs?

Practice

Make it stick

A second problem on the same idea, so it survives past today.

Define the SLI/SLO set for YouTube-style video playback at global scale, where 'the video plays' is the journey and CDN edges, adaptive bitrate, and buffering all affect perceived quality. Specify how you compute each SLI from telemetry and why client-side measurement is unavoidable here.

Think about

  1. Why can server/edge 2xx rates report health while users stare at a spinner?
  2. Why is rebuffer ratio a time-weighted SLI rather than a request ratio?
  3. Which SLIs live on the client and which stay server-side, and why keep both?