advanced
Backups
Protect data with scheduled backups, retention, encryption, restore drills, and recovery objectives tied to business impact.
Backups protect against operator error, corruption, ransomware, and regional failure. Define RPO (how much data you can lose) and RTO (how fast you must restore). Mechanisms: logical dumps, storage snapshots, continuous archiving (WAL/binlog), and cross-region replication—not interchangeable.
| Type | Pros | Risk | |------|------|------| | Logical dump | Portable, selective restore | Slow at huge scale | | Snapshot | Fast capture | Crash consistency without quiesce | | PITR (WAL) | Point-in-time | Replay chain must be intact |
Restore drills prove backups work; untested backups are wishful thinking. Encrypt at rest and in transit; restrict who can delete backup objects.
On interviews: state RPO/RTO for a payment service vs internal wiki; describe last successful restore test; mention immutability and off-site copies.
Common pitfalls: backup without restore runbook; snapshots only in same region; no retention policy; secrets in dump files; assuming replica equals backup.
The trade-off is storage cost and operational overhead versus survivable recovery when the primary is gone or corrupted.
Checklist:
- Define RPO and RTO for the service.
- Name backup type: logical, snapshot, PITR.
- Schedule and audit restore drills.
- Encrypt and tier retention (daily/weekly/monthly).
- Separate backup credentials from production admin.