High Availability and Disaster Recovery: SLOs, the Nines as Minutes, Single Points of Failure, RPO and RTO
TicketHub promises 99.9% over 30 days, which is 43.2 minutes of downtime a month; 99.99% is 4.32. One database is a single point of failure, so it gets a standby. A backup at 02:00 and a dead disk at 10:00 mean up to 8 hours of tickets lost (RPO), back at 11:30 means 1.5 hours down (RTO), and an untested backup is only a hope.
What you will learn
- Tell an SLI, an SLO and an SLA apart and turn the nines into minutes of downtime
- Spend an error budget and find single points of failure
- Choose between zones and regions, and between active-passive and active-active
- Work out RPO and RTO from a backup timeline and plan a restore drill
Before you start
- Scaling Out an AI Help Desk: Stateless Copies and Redis
- SLIs and SLOs for an LLM Service
Sooner or later a customer asks a simple question: how reliable is your app? And sooner or later a part of your system breaks. This article handles both. You'll leave with a number you can give the customer and a plan for the night something dies.
The example is TicketHub, a support-ticket app. Liam, a customer, emails: "How reliable is TicketHub?" You could answer "as reliable as possible", but nobody can check that. Then one night the disk inside the database server dies. So we need two things: a target we can measure, and a recovery plan we have practised before the disk dies.
SLI, SLO and SLA
Three short names that people mix up all the time:
- SLI, the thing we measure. For TicketHub: the share of requests answered correctly in under 300 ms.
- SLO, our target for that measurement: at least 99.9% of requests over 30 days. This one is ours; we aim for it.
- SLA, a promise in a contract, with a penalty if we break it. Set it looser than the SLO, say 99.5%, to keep room for bad days.
Measure it, aim for it, and only then promise it. For how to count good events and alert on an LLM service in particular, see SLIs and SLOs for an LLM service.
The nines, as minutes
99.9% sounds great, but how much downtime is it? A 30-day month has 30 × 24 × 60 = 43,200 minutes.
| Target | Allowed down | Downtime per 30 days |
|---|---|---|
| 99% | 1% of 43,200 | 432 minutes (7.2 hours) |
| 99.9% | 0.1% | 43.2 minutes |
| 99.99% | 0.01% | 4.32 minutes |
| 99.999% | 0.001% | 0.432 minutes, about 26 seconds |
Each extra nine cuts the allowed downtime by ten, and the work and money go up with it.
The error budget
If the target is 99.9%, then 0.1% of the month is allowed to fail: 43.2 minutes. That is the error budget, and we spend it when things go wrong. An incident on Tuesday takes 12 minutes, another on Friday takes 9. Twelve plus nine is 21 spent, so about 22 minutes are left.
The rule: if budget is left, ship features and take sensible risks. If it is used up, slow the releases and fix reliability first. "Be careful" turns into a number everybody can see.
Single points of failure
How do you earn those nines? First, by finding single points of failure: one part whose breaking stops everything.
If one app copy breaks, the other keeps going (that is what stateless copies behind a load balancer buy you). The database, though, is alone: if it dies, the whole app stops. The fix is a standby copy, ready to take over.
Zones and regions
Two copies only help if they don't break together. If both sit in the same building, one power cut takes both. So spread them out:
- A zone is a separate building with its own power, inside one area. Zone A and zone B sit next to each other on separate power.
- A region is a different part of the world. A flood or a big outage can hit a whole region.
Cloud providers describe zones and regions this way. Spread across zones for the small accidents; add a second region for the big ones if the data is worth it.
Standby or both working?
Active-passive: the main machine does the work and the standby waits. When the main one goes down the standby takes over. That switch is failover, and there is a short gap while it happens.
Active-active: both copies serve users all the time. When one dies the other is already working, so there is no gap, but keeping the data in step between two busy copies is harder.
A short gap and simple, or no gap and complicated. Pick by what your data and your budget allow. The same two shapes across whole regions, with the RTO added up step by step, are in multi-region: active-passive vs active-active.
Backups, RPO and RTO
Redundancy is not a backup. If someone deletes a table, both copies delete it. So we also keep backups, and two numbers describe what a failure costs.
- The last backup ran at 02:00. At 10:00 the disk dies. The most we can lose is everything since the backup: 10 minus 2, eight hours of tickets. That is the RPO, recovery point objective: how much data we may lose (unless we also keep the change log).
- We are back at 11:30. 11:30 minus 10:00 is one and a half hours down. That is the RTO, recovery time objective: how fast we must be back.
Can we do better? Ship the change log continuously and the RPO drops to minutes. Keep a ready standby and the RTO drops to minutes too.
The hospital generator
A hospital has a backup generator. Smart hospitals switch it on every month and watch it, so on the night of the storm it starts, because they already know it works. The other hospital never tested theirs. Storm night, the power goes out, they press the button. Click. Nothing.
An untested backup is not a backup. It is a hope. So schedule a restore drill: once a month, restore a real backup on a spare machine, time it and fix whatever fails. Failure drills shows one, timed against a 15-minute RTO.
Three ways compared
| Active-passive | Active-active | Backup only | |
|---|---|---|---|
| Cost | medium | highest | cheapest |
| Back in (RTO) | minutes | almost no time | hours |
| Data lost (RPO) | seconds to minutes | nearly nothing | everything since the last backup |
| Complexity | medium | highest | lowest |
Most real apps mix them: backups for everything, and a standby for the data that hurts most to lose.
Common mistakes
- Promising an SLA equal to (or tighter than) your SLO, with no room for bad days.
- Two copies in the same zone, so one power cut takes both.
- Treating a replica as a backup. It copies the deleted table too.
- Backups that are never restored, and no runbook for 3 a.m.
The reliability checklist
- Write the SLO as a number.
- List every single point of failure.
- Decide the RPO and RTO for each type of data.
- Automate the backups.
- Restore one every month.
- Write the runbook: who does what, in which order, at three in the morning.
- Alert when the error budget burns fast, so you hear about it before the customer does.
Recap
| Term | TicketHub number |
|---|---|
| SLO | 99.9% of requests OK in under 300 ms, over 30 days |
| SLA | looser, for example 99.5% |
| Error budget | 43.2 minutes a month; 21 spent leaves about 22 |
| RPO | backup 02:00, failure 10:00: up to 8 hours of tickets |
| RTO | failure 10:00, back 11:30: 1.5 hours |
Try it yourself: TicketHub has a 99.9% SLO over 30 days, so the budget is 43,200 minutes × 0.1%. Last month there was one 20-minute outage and one 15-minute outage. How much budget is left, and should the team slow down releases?
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
Fallback Models for an LLM App: A Chain That Checks Region and Fit, Flags Degraded Answers and Gets Rehearsed
When the main model goes down, the backup has to be allowed to take the data, able to read the whole request and tested before the bad day. A simulated four-model chain for an EU customer: a 6,000-token request lands on mid-eu, flagged degraded; a 10,000-token request is served by nobody, on purpose.
Back Pressure for LLM Traffic: Bound the Queue, Give Chat Its Own Lane, Count Tokens, Cancel When the Caller Leaves
A bulk upload buries the chat. In a small simulation, one shared queue grows to 199 waiting and the middle chat answer takes 80.2 s. A bound plus a chat lane brings it to 0.35 s while 178 bulk jobs are told to retry in 10 s, and cancelling abandoned calls saves 21,000 wasted tokens.
Load Balancing LLM Traffic: Count the Work, Weigh the Prefix Cache, Check Real Health, Drain Before Deploys
Six GPU replicas, two at 95% and four at 30%: round robin counts requests, and requests aren't equal. In a small simulation, least outstanding requests cuts p95 from 6.52 s to 3.05 s, prefix affinity lifts cache hits to 95% but pushes p95 to 11.45 s, a real health check takes errors from 48 to 2, and draining cuts 0 answers instead of 4.
A Message Queue for Document Ingestion: At Least Once, Leases, an Idempotent Consumer and a Dead Letter Queue
A queue doesn't lose a document, but it can hand one out twice. In a small simulation, a worker crash makes document two go from 3 to 6 chunks and the index holds 11 when the documents hold 8. An idempotent consumer brings it back to 8 with the same two deliveries, and a limit of three tries moves a poison file to a dead letter queue.
