Module 7 · Keeping It Running and Safe · Lesson 29 of 35
SLI vs SLO vs SLA: promising reliability you can measure
11 minFree System design course · Beginner to intermediateLesson 7.4By Saket Bhatnagar
Researched and drafted with AI, reviewed and edited by Saket Bhatnagar.
In short
- SLI vs SLO vs SLA: the SLI is what you measure, the SLO is your target, and the SLA is a promise with a penalty.
- The gap between your target and 100% is an error budget: failure you may spend on outages and risky changes.
- Aim tighter than you promise, like a pizza shop that aims for 25 minutes under a “30 minutes or free” sign.
Video lesson · coming soon
SLI vs SLO vs SLA: what counts as up?
Lala, your AI mentor, will walk you through this lesson in a short animated video. Until then, everything is here to read and try.
- 01 Was SeatJaldi up?
- 02 Thirty minutes or free
- 03 The error-budget fuel gauge
- 04 Guess the bad minutes
- 05 22 of 40 minutes spent
- 06 Say your SLO out loud
After the high-availability review, Meera Kulkarni can tell investors how much downtime SeatJaldi’s design allows. Then one investor asks a simpler question. “What counts as up?”
The 22-minute outage during the national final sale was clearly down. But last Thursday, tapping Book took about 6 seconds. The app answered every tap, and many fans gave up. Was SeatJaldi up?
Arjun Nair says yes, the servers answered. Zoya Mirza says no, fans could not book. Arjun’s fix: “Set the target at 100%. Anything less looks weak.” Sandeep Patil, dry as ever, asks what that does to the first deploy anyone ships.
“What do I promise?” Meera asks. “And if we miss?” Sandeep writes a target on the whiteboard: 99.9% of bookings good. Over 28 days that allows about 40 bad minutes, and the outage alone took 22. How much is left, and what happens when it runs out? Right now, they would only be guessing.
SLI vs SLO vs SLA: what is the difference?
An SLI is the number you measure, an SLO is your target for it, and an SLA is a promise to customers with a penalty.
Sandeep’s SLI is the share of booking requests that succeed within 1 second. For fans, Thursday was not up.
His SLO is 99.9% good over a rolling 28 days, always the last 28 days. The SLA, the promise with a penalty from the last lesson, sits looser. Say SeatJaldi promises event organisers 99.5%, with a fee refund if it misses (assumed).
| Term | What it is | SeatJaldi example |
|---|---|---|
| SLI | The number you measure | Booking requests that succeed within 1 second |
| SLO | Your own target for it | 99.9% good over a rolling 28 days |
| SLA | A promise with a penalty | 99.5% for organisers, with a fee refund if missed (assumed) |
Joseph’s few slow pizzas show the one line to keep: reliability is a budget you are allowed to spend.
- A delivery app promises “30 minutes or a coupon”. The minutes are measured, and the coupon is the penalty.
- A status page shows “99.95% over the last 90 days”. Someone decided what counts as up, measured it and published it.
- A company pauses new features for a week to fix stability. It had spent its allowance for failure, so its rule said slow down.
What is an error budget?
An error budget is the gap between your SLO and 100%: the failure you may spend on outages and risky deploys. Joseph’s few 27-minute pizzas, slower than his goal but inside his promise, are his budget.
The error-budget fuel gauge
Drag to exploreThe SLI is measured against the SLO. The gap up to 100% is the error budget, which outages and risky deploys spend. When it is empty, the policy pauses risky deploys. The SLA is a looser promise beyond the SLO.
Diagram connections:
- SLI to SLO 99.9% (Measured against)
- SLO 99.9% to Error budget (Leaves a gap)
- Outages and deploys to Error budget (Spend it)
- Error budget to Budget policy (When empty)
- SLO 99.9% to SLA (Looser promise)
- Budget policy to Outages and deploys (Pauses deploys)
- SLI: Booking requests that succeed within 1 second.
- SLO 99.9%: Target for the SLI over a rolling 28 days.
- Error budget: The 0.1% gap: about 40 minutes of bad time in 28 days.
- Outages and deploys: Each outage or risky deploy uses up some budget.
- Budget policy: When the budget is gone, risky deploys pause.
- SLA: The looser promise to customers, with a penalty.
Zoya writes the rule before anyone needs it. While budget is left, the team ships as usual. Once it is spent, risky deploys pause and reliability comes first. That written rule is the error-budget policy. Because the window rolls, old bad minutes drop out after 28 days.
What are some SLO examples for a booking app?
A good SLO measures something users feel, such as bookings that succeed within 1 second. Joseph counts hot pizza at the door, not his oven’s temperature.
| What users feel | SLI | SLO |
|---|---|---|
| My booking went through fast | Booking requests that succeed within 1 second | 99.9% over 28 days |
| The seat map opened quickly | Seat-map views that load in under 2 seconds | 99% over 28 days |
| I got my payment confirmation | Payments confirmed to the fan within 1 minute | 99.5% over 28 days |
- Bad SLI: “CPU is under 40%.” The CPU, the machine’s processor, is a cause; bookings can fail while it is calm.
- Bad SLI: “The server is up.” On Thursday the server answered, and fans still left.
- Good SLI: good booking requests out of all booking requests, counted from the fan’s side.
How do engineers choose SLIs and use an error budget?
Pick SLIs from the user’s side, keep the SLO below 100% and above the SLA, and agree early what happens when the budget runs out.
- Keep a handful of SLIs, and define “good” exactly: a status code below 500, so no server error, within 1 second.
- Set the target from what users need, not from what you hit today.
- Track the latency of failed requests separately, or fast errors make latency look healthy.
- Use whole weeks: 28 days always holds 4 weekends, so busy Sundays count the same.
Mind the margin. Meera’s assumed SLA of 99.5%, with a fee refund if missed, allows 0.5% × 40,320 = 201.6 minutes in the same 28 days. That is five times the team’s 40.32. As lesson 28 showed, “designed for” is a goal; only an SLA carries a penalty.
Engineers also watch how fast the budget drains.
If every booking fails, that is 1,000 times the allowed 0.1%, a burn rate of 1,000. A full 40.32-minute budget is gone in 40.32 minutes. If 1% fail, the rate is 10 and the budget lasts 2.8 days.
SELECT
ROUND(100.0 * SUM(CASE WHEN status < 500 AND duration_ms <= 1000 THEN 1 ELSE 0 END)
/ NULLIF(COUNT(*), 0), 3) AS booking_sli_percent
FROM booking_requests
WHERE created_at >= NOW() - INTERVAL '28 days';What just happened? Good requests divided by all requests, times 100, in PostgreSQL-style SQL. With 10,000 mocked rows, 6 failed and 4 slow, it returns 99.9. With no rows, it returns one row holding NULL, an empty value, instead of a divide-by-zero error.
Here only server errors, codes 500 and up, count as failed. Decide on purpose whether a 429, which turns a fan away, should count as bad too. Real systems keep running counts rather than reading every row.
Zoya’s policy follows the example in Google’s site reliability workbook. Once the budget is spent, deploys stop except urgent and security fixes. Any outage that eats over a fifth of it, about 8 minutes, gets a written review with at least one fix. The outage qualifies.
Try it yourself
Write the SLI
For the booking API, write one sentence: what share of which requests counts as good?
Set the SLO
Use 99.9% over a rolling 28 days, the SLO Sandeep chose.
Do the budget
Work out 28 × 24 × 60 × 0.001 minutes, then the share a 22-minute outage uses.
Check
You are right if your SLI is good requests out of all requests and the budget is 40.32 minutes. The outage uses about 55%, leaving about 18.
Back to the whiteboard: 40.32 − 22 leaves 18.32 minutes. That is the minutes view; counted in bookings, a peak-sale outage spent far more of it. Deploys go out carefully now, and if the budget runs dry, risky ones pause until enough old bad minutes roll out of the 28-day window.
Meera’s investor slide has three sentences. “We measure the share of bookings that succeed within one second. We aim for 99.9% over 28 days and promise organisers 99.5%, with a fee refund if we miss. If we miss our target, new features pause until reliability is fixed.” Like Joseph, she aims tighter than she promises.
Thursday has an answer too: those 6-second bookings were bad minutes. To measure this, Sandeep needs to see inside the system. There were dashboards everywhere, yet nobody saw the last outage coming.
Check yourself
Check yourself
SeatJaldi’s budget is 40.32 minutes in 28 days and one outage took 22. What should happen next?
Pick an answer to see why it is right or wrong.
Check yourself
Why not set the SLO at 100%?
Pick an answer to see why it is right or wrong.
Remember these three
- Reliability is a budget you are allowed to spend: the gap between your SLO and 100%.
- The SLI is measured from the user’s side, the SLO is your target, and the SLA is a looser promise with a penalty.
- Agree the budget policy early: when the budget is spent, risky deploys pause.
Questions people ask
- What is the difference between SLI, SLO and SLA?
- An SLI is what you measure, and an SLO is your target for it. An SLA is a promise to customers with a penalty, such as a refund. The SLO is kept stricter, so problems get fixed before a penalty is due.
- What is an error budget?
- An error budget is the gap between your SLO and 100%. At 99.9% over 28 days, it is about 40 minutes of bad time, which outages and risky deploys may spend.
- What are some SLO examples?
- One is “99.9% of booking requests succeed within 1 second over 28 days”. Another is “99% of seat-map pages load in under 2 seconds”. Each one measures something users feel.