Sub topic 1
What you are protecting against: AZ failures, Region failures, and data loss
Disaster recovery (DR) plans start from one question: what kind of failure are you preparing for? The answer decides whether you need a second Availability Zone, a second Region, or only a good backup. This chapter separates three failure scopes so later chapters can match a strategy to each one.
Prerequisites
This chapter assumes you know the following:
- What AWS Regions and Availability Zones (AZs) are.
- The basics of VPCs, EC2, and S3.
- That managed databases such as RDS, Aurora, and DynamoDB exist.
- How to read JSON and AWS CLI commands.
Three failure scopes
A Region is a geographic area. It contains several AZs, which are separate data center groups with independent power, cooling, and networking. Failures happen at different scopes, and each scope needs a different defense.
| Scope | Example | Typical defense |
|---|---|---|
| Single resource or host | An EC2 instance crashes | Auto Scaling, health checks |
| One AZ | Power or network loss in one data center group | Multi-AZ deployment inside the Region |
| One Region | A regional service event, or a large natural disaster | Disaster recovery in a second Region |
| Data loss or corruption | Accidental delete, bad deployment, ransomware | Backups, versioning, point-in-time recovery |
AZ failures: high availability
Losing one AZ is the most common serious failure. You handle it with high availability (HA). HA means the workload keeps running in the same Region by spreading across AZs. Examples are an Auto Scaling group across three AZs behind an Application Load Balancer, or an RDS Multi-AZ database that fails over to a standby.
HA is not DR. Both AZs live in one Region, so a Region-wide problem takes out the primary and the standby together.
You can list the AZs your account sees in a Region:
aws ec2 describe-availability-zones \
--region us-east-1 \
--query "AvailabilityZones[].[ZoneName,State]" \
--output tableRegion failures: disaster recovery
A Region-level event is rare, but it is the case that DR strategies are built for. To survive it, you need a copy of your data and a way to run the workload in a different Region. The rest of this tutorial covers four ways to do that. They differ in how much runs in the second Region before the disaster.
Data loss: a failure that replication can make worse
Some disasters are not outages. A developer deletes a table, a faulty release writes bad records, or an attacker encrypts your data. These are logical failures, because the infrastructure is healthy but the data is wrong.
Replication copies changes quickly, and that includes harmful ones. A delete in the primary Region appears in the replica within seconds. Protecting against data loss therefore needs point-in-time copies, such as backups, S3 versioning, or database point-in-time recovery. Replication alone is not enough.
How the scopes relate
Common mistakes
- Treating Multi-AZ as disaster recovery. It covers an AZ failure only.
- Assuming replication replaces backups. It copies mistakes too.
- Planning for a Region failure without checking that the second Region has the same services, quotas, and capacity you need.
- Keeping backups only in the primary Region, where a regional event can make them unreachable.
Exercise
A team runs an Auto Scaling group across three AZs and an RDS Multi-AZ database in us-east-1. An engineer accidentally runs a DELETE without a WHERE clause on a production table. Which failure scope is this, and does their current setup protect them?
Show answer
This is data loss (a logical failure). The Multi-AZ setup does not protect them, because the standby applies the same delete almost immediately. They need point-in-time recovery or backups taken before the delete. A cross-Region replica would also copy the delete, so it would not help either.