The Time Machine: EBS Snapshots
An EBS Snapshot is a point-in-time backup of your volume, stored durably in S3 (though you access it through the EBS API, not the S3 console). Snapshots are the primary mechanism for backup, disaster recovery, and cross-region data movement.
How incremental snapshots work:
The first snapshot of a volume copies all data — if your volume is 100 GB and 60 GB is used, the first snapshot stores 60 GB. Every subsequent snapshot is incremental: it only stores the blocks that changed since the last snapshot.
Snapshot 1 (Monday): Full — 60 GB stored
Snapshot 2 (Tuesday): Only changed blocks — 2 GB stored
Snapshot 3 (Wednesday): Only changed blocks — 500 MB stored
This makes daily snapshots fast and cheap. However, each snapshot is still a complete, independent restore point. You do not need Snapshot 1 to restore from Snapshot 3 — AWS handles the block-level reconstruction transparently.
Cross-AZ and Cross-Region movement:
EBS volumes are AZ-scoped. Snapshots are Region-scoped. This asymmetry is how you move data:
Volume in us-east-1a → Snapshot (us-east-1) → New Volume in us-east-1b
→ Copy Snapshot to us-west-2
→ New Volume in us-west-2
Snapshot consistency:
For a database, taking a snapshot of a running volume without preparation can result in an inconsistent backup — data that was in memory but not yet flushed to disk will be missing. Best practice:
- Use the database's native flush/freeze mechanism (e.g.,
FLUSH TABLES WITH READ LOCKin MySQL, or VSS on Windows). - Take the snapshot.
- Release the lock.
AWS Systems Manager Automation documents can orchestrate this sequence automatically.
The Robot: Data Lifecycle Manager (DLM)
Manual snapshots are fine for one-off operations. For production systems, you need automation. Amazon Data Lifecycle Manager (DLM) lets you define policies that run on a schedule.
A DLM policy specifies:
- Target: Which volumes to back up (selected by EC2 or EBS tags, e.g.,
Env: Production). - Schedule: How often to snapshot (every 1, 2, 4, 6, 8, 12, or 24 hours).
- Retention: How many snapshots to keep, or how many days to retain them.
- Cross-Region Copy: Optionally copy each snapshot to another region for disaster recovery.
Example policy in plain English:
"Every 6 hours, take a snapshot of every EBS volume tagged
Backup: DLM. Keep the last 14 snapshots. Copy each snapshot toeu-west-1and keep those copies for 30 days."
DLM is free — you only pay for the snapshot storage in S3. For most production environments, DLM plus a 24-hour snapshot schedule is the minimum acceptable backup posture.
EBS Snapshot Archive:
For long-term retention (compliance, legal hold), you can archive snapshots to a cheaper storage tier. Archived snapshots cost ~75% less than standard snapshots but require 24–72 hours to restore. Use this for snapshots you need to retain for years but hope never to use.