AI Hints
Home›System Design Tutorial›Observability
System Design · Lesson 87 of 120

SLIs, SLOs and SLAs

Promises in numbers.

⏱ 2 min read▶ Video at 1:44:35🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

How reliable should Shoply be? A hundred percent is impossible, and chasing it is very expensive. Instead, teams agree on precise targets. Three similar acronyms describe them.

SLIs, SLOs and SLAs
From the video: SLIs, SLOs and SLAs
  • 100% is impossible
  • Agree on targets
  • Three acronyms

Three terms

An SLI, a service level indicator, is a measurement, like the share of requests faster than three hundred milliseconds. An SLO, an objective, is your target for it, like ninety nine point nine percent. An SLA, an agreement, is a promise to customers, with a penalty, like a refund, if you miss it.

TermWhat it isExample
SLIa measurement% of requests under 300 ms
SLOyour target99.9% each month
SLAa promise with penaltiesrefund below 99.5%

An error budget

An SLO gives you an error budget. With ninety nine point nine percent, one request in a thousand may fail. Here, a month has ten million requests. Run it. We're allowed ten thousand failures, and we've used seven thousand five hundred. Seventy five percent of the budget is spent, so maybe slow down risky releases this month.

budget.pypython
slo = 0.999
requests = 10_000_000
failed = 7_500

budget = requests * (1 - slo)
print(f"error budget: {budget:,.0f} failures")
print(f"used: {failed:,} ({failed / budget:.0%})")
print(f"left: {budget - failed:,.0f}")
Output
error budget: 10,000 failures
used: 7,500 (75%)
left: 2,500

Summary

SLIs measure, SLOs set targets, and SLAs are promises with penalties. The gap between a hundred percent and your SLO is your error budget. Next, giving every record a unique ID, at scale.

Key takeaways
  • SLI: measure
  • SLO: target
  • Error budget
Next up: Unique IDs at Scale — snowflake IDs