DataUpdated 2026-11-20

Backups

Why replication is not a backup: backup types, recovery objectives, restore tests, and where disaster recovery starts.

A dated copy of the ledger in another building, for when things go wrong.

That is a backup. It is not a second desk that mirrors the first. It is an older, separate copy that you can go back to after a mistake.

How it works

The point of a backup is to recover from a historical, independent snapshot. That is what separates it from replication.

Code
Replication:  Primary → Replica      (mirrors every change, including mistakes)
Backup:       Primary → Snapshot     (frozen at a moment, stored apart)

If someone deletes the wrong rows on the primary, the delete reaches the replica a moment later. Both copies now hold the bad state. Only a backup taken before the mistake can bring the data back. See read replicas for what replicas are for.

Types of backup

  • Full backup. A complete copy on a schedule, daily for example.
  • Point-in-time recovery. Replay the transaction log to restore the database to any chosen moment, such as one minute before the bad deploy.
  • Snapshots. Storage-level copies of a disk or volume.

Many setups combine them: a regular full copy, plus the log for precision between copies.

Two numbers to agree on

  • RPO, recovery point objective. How much data you can afford to lose. A daily backup means up to a day of loss. Point-in-time recovery shrinks that to minutes.
  • RTO, recovery time objective. How long recovery may take before the business is hurt.

These numbers drive the design. Without them, "we have backups" has no meaning.

A checklist

  • Backup frequency matches the acceptable data-loss window.
  • Copies live in a separate location or region from the primary.
  • The restore process is tested, not assumed. A backup that has never been restored is a hope.
  • A retention policy says how long copies are kept, and why.

Where disaster recovery starts

Disaster recovery asks what happens if a whole region goes down. A multi-region setup answers it, at a real cost in complexity, cross-region replication and doubled infrastructure. For an early or small product, a single region with good backups and a written, tested recovery runbook is usually enough and far cheaper.

Practising the restore

A restore drill is a scheduled, boring exercise: restore the latest backup into a separate environment, run a few checks, and record how long it took and what was missing. The drill proves the copy is readable, that the keys and permissions work, and that the documented steps are correct. It also gives you a real RTO instead of a guess. Repeat it after any change to the database setup, and keep the written runbook next to the results so the next person can follow it under stress.

Where I used it

I haven't shipped a backup and restore setup in a public project yet.

In my POS SaaS design, I record that the database is a single point of failure. I accepted that, with managed failover and point-in-time recovery, and I wrote down when to revisit it. POS is early-stage, so this is a design decision and not a tested restore.

Trade-offs

  • Storage cost. Retention multiplies copies. Decide how long each kind is worth keeping.
  • Restore takes time. Large databases can take hours. Know the figure before you need it.
  • Untested backups fail. Permissions, missing keys and corrupted files are all found only by restoring.
  • Backups hold sensitive data. A copy is another place personal data lives, so it needs the same access control and encryption as the original, and a deletion policy that covers it.
  • Multi-region is expensive. Compare its cost with the real business cost of downtime before committing.

A useful rule: write down RPO and RTO first, store copies somewhere else, and restore on a schedule to prove it works.