Concept guide

High availability and disaster recovery

Servers break, data centers lose power, and people delete data by mistake. High availability means keeping your service running even when that happens. Disaster recovery means bringing it back within a time you've agreed on when it does go down anyway. Every cloud provider uses different names, but the skeleton is the same. We'll look at the skeleton first, then see what's different for each provider, chapter by chapter.

You’re viewing this for AWS. Each chapter also shows AWS’s service names and how it differs from other providers.

01

Failures will happen: availability numbers and single points of failure

Availability is the share of time your service was usable. 99.9% sounds pretty high, but over a year it means about 8 hours 45 minutes of downtime. Every extra 9 cuts the downtime you're allowed to a tenth, and the cost and the design get harder by about as much.

AvailabilityDowntime per yearDowntime per month
99%About 3 days 15 hoursAbout 7 hours
99.9%About 8 hours 45 minutesAbout 43 minutes
99.95%About 4 hours 22 minutesAbout 22 minutes
99.99%About 52 minutesAbout 4 minutes
99.999%About 5 minutesAbout 26 seconds

Chain things together and it goes down; put them side by side and it goes up

A service is made of several components linked together. If a response has to pass through a web server, then an app server, then a DB, all three have to be up. So the overall availability is the product of each component's availability. Chain three 99.9% components and you drop to about 99.7%. Put two identical servers side by side instead, and that tier only goes down if both do, so it climbs to 99.9999% (assuming the two fail independently). In the scene below, try doubling up each tier.

Overall availability
99.7% (~26.3 hours down a year)

A request has to go web → app → DB to be served · top left = availability per tier

Even if each component is 99.9%, chaining three together means all three have to be up at once, so the overall number drops to 99.7%. Put two identical servers side by side instead, and that tier only goes down if both do, so it climbs to 99.9999%. (This math assumes failures are independent of each other.)

A spot where one thing stopping stops everything is called a single point of failure. Designing for high availability is the work of finding single points of failure and removing them one by one. And it's not just servers. A DB, a load balancer, a network path, even "the one person who knows how this server is set up" can be a single point of failure.

An SLA is a refund promise, not a guarantee

Each cloud service promises a monthly uptime through its SLA (service level agreement). Here's the part that trips people up: an SLA isn't a guarantee that "it will definitely run this much." It's a promise that "if we miss it, we'll give part of your bill back as credits." It doesn't cover what you lose while you're down, so your own service's availability has to come from your design. Even for the same service, the SLA is higher when you spread it across several zones than when you run a single server.

A classic exam calculation: in series, multiply (99.9% × 99.9% ≈ 99.8%); with redundancy, it's 1 − (1 − a)² (two 99.9% servers → 99.9999%). "Most cost-effective way to raise availability" → make the weakest single point of failure redundant first.

If a question says… → pick this

  • “A component that stops everything when it stops”Single point of failure (SPOF)
  • “Overall availability of three 99.9% components in series”About 99.7% (multiply)
  • “Running two of the same server makes availability”Go up — both have to fail to go down
  • “What you get when the SLA is missed”Service credits (not compensation for losses)
  • “Yearly downtime at 99.99% availability”About 52 minutes

To get rid of a single point of failure, you went from one server to two. But what if those two sit in the same building?

02

How big a failure gets: servers, zones and regions

Failures come in different sizes. Sometimes one server's disk dies. Sometimes an entire data center goes down from a power outage, fire or network failure. And once in a while, a whole geographic area goes down from a natural disaster or a massive outage. The area a single failure affects is called its blast radius.

The cloud shows you this range as availability zones and regions. A region is a geographic area like Seoul or Tokyo, and inside it are several availability zones: groups of data centers, each with its own independent power, cooling and networking. Zones are close enough for synchronous replication (a few milliseconds of latency), yet far enough apart that a disaster in one won't spread to another.

Layout
Failure
Layout
One each in two Availability Zones
Result
Service stays up

Where you put two servers decides how big a failure they can survive

You split the two servers across different Availability Zones, so even if one Availability Zone goes down entirely, the other one takes over. This is the baseline setup most services aim for. Every AWS Region has at least three Availability Zones, and they’re all within 100 km of each other.

LayoutServer failureZone failureRegion failureCost and complexity
Several servers in one zoneSurvivesGoes downGoes downLow
Spread across zonesSurvivesSurvivesGoes downMedium — the usual default
Spread across regionsSurvivesSurvivesSurvivesHigh — replication lag and cost

Most production services use multiple zones as the baseline. They're in the same region, so latency is low enough to replicate the DB synchronously, and you survive a zone failure. You only expand to multiple regions when you also have to survive a region failure (laws and regulations, or a very large service), and how you do that is the disaster recovery strategies in chapter 7.

If a question says… → pick this

  • “Keep the service up even if one data center goes down”Spread across multiple availability zones
  • “Keep the service up even through a region-wide disaster”A copy in another region (disaster recovery)
  • “The weakness of putting two servers in the same zone”They go down together in a zone failure
  • “Why synchronous replication between zones is possible”They're in the same region, so latency is low
  • “The area a single failure affects”Blast radius

To decide how much you need to survive, you first need a target. How long can you afford to be down, and how much data can you afford to lose?

Advertisement

03

What to protect, and how much: RTO and RPO

When you design disaster recovery, there are two numbers you decide first. RPO (recovery point objective) is "how much data can you afford to lose when something fails," written as an amount of time. RTO (recovery time objective) is "how long can you afford to be down."

It's easier if you put the moment of failure in the middle. Looking back, everything since the last point where you protected your data (the last backup or replication) is the data you lose: that's the RPO. Looking forward, everything until the service opens again is your downtime: that's the RTO. In the scene below, try changing how you protect data and how you recover.

How you protect data
How you recover
RPO
24 hours
RTO
8 hours

From the moment of failure, RPO looks back and RTO looks forward · log time scale, example numbers

RPO is “how much data can you afford to lose when something fails,” written as an amount of time. With “Back up once a day,” you could lose up to 24 hours of data that piled up right before the failure. RTO is “how long can you afford to be down.” Here we assume “Rebuild and restore from backup” takes about 8 hours. The shorter you make either one, the more it costs.

RPORTO
What it asksHow many minutes or hours of data can you lose?How many minutes or hours can you be down?
What decides itBackup frequency, replication methodHow you recover, how ready your standby environment is
Near zero needsReal-time (synchronous) replicationA standby environment that is already running

These two targets are set by the business, not the technology. An order system loses a lot if it's down for even a minute and can't lose a single order, while an internal reporting system might be fine being down for a day. The tighter the target, the higher the cost, so you weigh losses against cost for each system. If recovering costs more than what the outage would lose you, you've set the target too high.

"Up to 15 minutes of data loss is acceptable" → RPO 15 minutes. "Service must resume within 4 hours" → RTO 4 hours. Remember RPO as "data" and RTO as "time (downtime)."

If a question says… → pick this

  • “Maximum acceptable data loss in a failure”RPO (recovery point objective)
  • “Maximum time allowed before service resumes after a failure”RTO (recovery time objective)
  • “RPO of a system that is only backed up once a day”Up to 24 hours
  • “Getting RPO close to zero”Real-time (synchronous) replication
  • “The tighter the RTO and RPO”The higher the cost

With the targets set, it's time to keep things from stopping. First up: how to keep servers standing when requests suddenly pour in.

Pro only

That’s the free part of this guide

The other 5 chapters are open to Pro subscribers. Each one continues with 3D visuals and “if a question says…” tips, and the last chapter lets you check yourself with a short quiz.

  1. 04Scaling and auto scaling
  2. 05Replication and DB failover
  3. 06Backup and restore
  4. 07Four disaster recovery strategies
  5. 08Designing for resilience and testing it