Backup and Archival
Copies you trust when the originals fail
Backups protect against deletion, corruption and ransomware; archives keep long-lived copies cheap. The discipline is RPO/RTO-aware: what you need back, how much you can lose, and how fast.
What you will learn
- Craft a backup strategy mapped to RPO/RTO
- Use snapshots, object versioning and managed backup services
- Design immutable, off-site archives
Backups = restorable copies within your RPO window and RTO restore speed; archives = long-term immutable retention cheaply. Services: AWS Backup/EBS snapshots, Azure Backup/recovery vaults, GCP backups + snapshots. Test restores, or it's not a backup.
What is this?
Backup layers: object versioning (point-in-time restore), volume/DB snapshots (fast restores), managed backup services (AWS Backup, Azure Backup, GCP backups) with schedules, retention, and cross-region copy. Archives: S3 Glacier/Deep Archive, Azure Archive, GCS Coldline/Archive, WORM/object-lock for immutable legal retention. RPO = max data loss, RTO = max downtime target.
Why do you need it?
- Snapshot restores beat 're-scraping from production' by orders of magnitude.
- Immutability (WORM/object-lock) survives ransomware and accidents.
- Cross-region copies survive an entire region loss.
- Known restore path = calm incident response instead of panic archaeology.
Mental model
Old film negatives in a fireproof, vaulted archive
Backups and archives
You keep recent shots handy (working snapshots = hot), keep a vaulted copy offsite (cross-region), and keep negatives locked immutably (archive) so even a corrupted edit can't erase the original.
How it works
- Schedule backups at a cadence matching RPO; keep enough to restore 'yesterday' or 'last week'.
- Snapshots are incremental and instant at the block level; restores create a working volume from them.
- Managed backup services automate policy: frequency, retention window, cross-region copy, vaulting.
- Versioning + object-lock provide near-RPO=0 restores for object stores and ransomware-proof retention.
- Restore drill: restore to a staging environment and verify integrity — the only proof it works.
Backup architecture.
Examples
A defensible backup policy
# AWS: one backup plan, retains 30 daily + 12 monthly + 7 yearly, copies cross-regionaws backup create-backup-plan --backup-plan '{ "BackupPlanName": "prod", "Rules": [{ "RuleName": "daily", "TargetBackupVaultName": "prod-vault", "ScheduleExpression": "cron(0 1 * * ? *)", "StartWindowMinutes": 60, "CompletionWindowMinutes": 240, "Lifecycle": { "DeleteAfterDays": 35 }, "CopyActions": [{ "DestinationBackupVaultArn": "arn:aws:backup:eu-west-1:ACCT:backup-vault:dr" }] }]}'Daily backups, 35-day retention, automated cross-region copy — a complete policy in one declaration.
In production
- A SaaS product snapshots databases hourly and keeps 14 days hot, 2 months in vault, 3 years archived.
- Azure Recovery Services vault backs VMs daily with 30-day retention and does application-consistent restores.
- GCP object-lock hooks secure audit logs against tampering for 7 years.
Best practices
- Document RPO/RTO per data tier; never back up what you never restore.
- Test-restore on a cadence (quarterly drills); capture restore durations against SLAs.
- Enable immutable/object-lock retention for the windows you promise compliance.
- Cross-region copy for tier-1 datasets; write down fallback restore order.
Common mistakes
- 'We have backups' = snapshots that were never restore-tested.
- Retention set to 'forever' → bills balloon and restore becomes archaeology.
- Backing up only the DB but not its config/migrations/keys.
- Archives without object-lock aren't ransomware-proof.
Common issues
Restore returns zero-byte DBCrash-consistent snapshot of a live DB
Use application-consistent backups (freeze/fsync) or DB-native dumps over raw volume snapshots.
Backup 'succeeded' but object missingVault lifecycle expired it or a policy gap
Check lifecycle days vs restore window; run a restore drill against the same vault.
Debugging tips
- Restore failing: check IAM of the vault/bucket, region replication lag, and encryption key access.
- 'Delete after 35 days' needs versions to expire on the vault, not raw deletion.
- Snapshot consistency: DB dumps (pg_dump) are crash-consistent unless you run application-consistent backups.
- Log backup failures as incident-worthy; silent last-success should be immutable.
Interview checkpoint
Hands-on lab
- Write a backup policy mapped to RPO/RTO
- Codify it (AWS Backup plan or equivalent)
- Plan and simulate a restore drill end to end
Design a Backup Policy and Prove It with a Restore Drill
25 min · intermediate
Quick quiz
The best test that a backup 'works' is which of these?