0
0
AWScloud~5 mins

Disaster recovery strategies (backup, pilot light, warm standby) in AWS - Commands & Configuration

Choose your learning style9 modes available
Introduction
Disasters can cause your cloud services to stop working. Disaster recovery strategies help you prepare so you can restore your services quickly. Backup, pilot light, and warm standby are three ways to keep your data safe and services running.
When you want to save copies of your data regularly to restore after accidental deletion or corruption.
When you want a minimal version of your system running in another region to quickly scale up after a disaster.
When you want a smaller but fully functional version of your system running to take over quickly if the main system fails.
When you want to reduce downtime by having a ready-to-use backup system.
When you want to balance cost and recovery speed by choosing the right recovery method.
Commands
This command downloads a backup file from an S3 bucket to your local machine. It is used to restore data from a backup.
Terminal
aws s3 cp s3://my-backup-bucket/backup-file.tar.gz ./
Expected OutputExpected
download: s3://my-backup-bucket/backup-file.tar.gz to ./backup-file.tar.gz
cp - Copy files between S3 and local or between S3 buckets
This command deploys a minimal version of your infrastructure (pilot light) using CloudFormation. It sets up essential resources in another region.
Terminal
aws cloudformation deploy --template-file pilot-light-template.yaml --stack-name pilot-light-stack --region us-east-1
Expected OutputExpected
Waiting for stack create/update to complete... Successfully created/updated stack - pilot-light-stack
--template-file - Specifies the CloudFormation template file to use
--stack-name - Names the CloudFormation stack
--region - Specifies the AWS region to deploy the stack
This command increases the number of running instances in the warm standby environment to handle traffic after a disaster.
Terminal
aws autoscaling update-auto-scaling-group --auto-scaling-group-name warm-standby-asg --desired-capacity 2 --region us-east-1
Expected OutputExpected
No output (command runs silently)
--auto-scaling-group-name - Specifies the name of the Auto Scaling group to update
--desired-capacity - Sets the number of instances to run
--region - Specifies the AWS region
This command checks the status of instances in the warm standby environment to ensure they are running and ready.
Terminal
aws ec2 describe-instances --filters Name=tag:Environment,Values=warm-standby --region us-east-1
Expected OutputExpected
{ "Reservations": [ { "Instances": [ { "InstanceId": "i-0abcd1234efgh5678", "State": { "Name": "running" }, "Tags": [ { "Key": "Environment", "Value": "warm-standby" } ] } ] } ] }
--filters - Filters instances by tags or other criteria
--region - Specifies the AWS region
Key Concept

If you remember nothing else from this pattern, remember: disaster recovery strategies balance cost and recovery speed by using backups, minimal setups, or ready-to-run standby systems.

Common Mistakes
Not regularly updating or testing backups
Backups may be outdated or corrupted, making recovery impossible or incomplete.
Schedule regular backups and perform test restores to ensure data integrity.
Deploying pilot light or warm standby environments in the same region as the primary system
A regional disaster can affect both environments, defeating the purpose of disaster recovery.
Deploy recovery environments in different AWS regions to ensure availability.
Not scaling up warm standby instances after a disaster
The standby environment remains under-provisioned and cannot handle production traffic.
Use commands or automation to increase capacity in the warm standby environment promptly.
Summary
Use AWS S3 to store and retrieve backups for data recovery.
Deploy a pilot light environment with minimal resources using CloudFormation to prepare for quick scaling.
Manage warm standby environments with Auto Scaling groups to keep a ready-to-use system running.
Verify the status of standby instances to ensure they are operational before switching traffic.