Book a 30-min callBook a call

Backups and disaster recovery: RPO, RTO, point-in-time recovery and restore tests

How to plan backups and disaster recovery: RPO and RTO, full vs incremental, PostgreSQL WAL archiving and PITR, 3-2-1 copies, restore tests and DR drills.

A database cylinder sending copies to three backup boxes, one with a padlock, and a dashed arrow to a scratch database circle marked with a tick.
Written by
BYD Tech
Published
Topic
Deep dives
Reading time
15 min read

Questions people ask

What is the difference between RPO and RTO?

The recovery point objective is how much data you can afford to lose, measured back from the moment of the outage to the last good copy. The recovery time objective is how long the system can be unavailable. RPO drives how often you back up or archive; RTO drives how much you keep ready to take over.

Is pg_dump enough to back up PostgreSQL?

For a small database where losing up to the interval between dumps is acceptable, it can be. A dump only restores to the moment it started. For a smaller RPO, take base backups and archive WAL continuously so you can recover to any point in time, and keep logical dumps as a second, portable copy.

Is a database replica a backup?

No. A replica protects against losing a machine or a region, but it copies mistakes and corruption as quickly as good writes. You still need point-in-time backups kept apart from the primary to recover from a bad migration, an accidental delete or ransomware.

How often should I test restores?

Often enough that a broken backup is found long before you need it. A common pattern is an automated restore test of every new backup or of the latest one on a schedule, with alerts, plus a fuller drill of the runbook a few times a year. CISA advises testing backups regularly in a disaster recovery scenario.

What does the 3-2-1 backup rule mean?

Keep three copies of important data, one primary and two backups, on two different types of media, with one copy offsite. It comes from a 2012 US-CERT paper. For ransomware, make at least one copy offline or immutable so the attacker’s credentials cannot delete it.

Building something like this?