Storage
Intermediate 12 min read Storage

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.

backuparchiveRPORTOsnapshotimmutableretention
Prerequisites: Disaster Recovery
Before we start

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
In 60 seconds

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.

Introduction

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.

Motivation

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.
Think about it

Mental model

Imagine

Old film negatives in a fireproof, vaulted archive

Think of

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.

Mechanics

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.

Primary data
Policy
Backup store
Cross-region copy
Restore drill
Hands-on

Examples

A defensible backup policy

A defensible backup policy
# AWS: one backup plan, retains 30 daily + 12 monthly + 7 yearly, copies cross-region
aws 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.

Real world

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.
Guidelines

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.
Watch out

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.
Root cause analysis

Common issues

Error
Restore returns zero-byte DB
Root cause

Crash-consistent snapshot of a live DB

Fix

Use application-consistent backups (freeze/fsync) or DB-native dumps over raw volume snapshots.

Error
Backup 'succeeded' but object missing
Root cause

Vault lifecycle expired it or a policy gap

Fix

Check lifecycle days vs restore window; run a restore drill against the same vault.

When things break

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.
Interviews

Interview checkpoint

Practice

Hands-on lab

Design a Backup Policy and Prove It with a Restore Drill
25 min · intermediate
In progress
Objectives
  • 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

0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/1
1

The best test that a backup 'works' is which of these?

Go deeper

Official documentation