Module O-7·28 min read

Backup tiers, point-in-time recovery, cold/warm/hot standbys, immutable and air-gapped copies against ransomware, and the rule that an unrestored backup is not a backup.

JJS
Written by Jatin Jain Saraf · Senior Software Engineer

Module O-7 — Disaster Recovery: RTO and RPO

What this module covers: The failures too large for Phase 3 to absorb — a region gone, a table dropped, a migration that corrupted three hours of data, a ransomware event, an account compromise. Why disaster recovery is not high availability, and why replication is not backup: it copies your mistakes faithfully and immediately. RPO and RTO as business decisions with cost curves, stated per data class rather than once for the company — including the class that needs no backup at all. Point-in-time recovery as the capability that saves you from the DELETE at 14:32, and the silent failure that ends your PITR window without anyone noticing. How ransomware changed the requirements, since an attacker with your credentials deletes the backups first. The standby spectrum and what each tier costs. Then the rule the whole subject reduces to — an unrestored backup is not a backup — with the specific discoveries a restore test makes, the data-loss decision somebody must be authorised to take, and the list of things besides the database that must also be recoverable, including the runbook itself.


Disaster Recovery Is Not High Availability

These get conflated, and the conflation causes a specific, common, catastrophic belief.

High availabilityDisaster recovery
Handlescomponent failurecatastrophic loss
Triggerautomatica human decision
Timescalesecondsminutes to days
Mechanismreplication, failover, multi-AZbackups, restores, standby sites
Protects againstan instance, disk or zone failingdeletion, corruption, ransomware, region loss

And the belief to demolish:

Replication is not backup, because replication copies your mistakes at the speed of light.

A DELETE FROM orders with no WHERE clause is replicated to all three standbys in milliseconds. A migration that corrupts a column is replicated. A ransomware process encrypting files is replicated. Multi-AZ synchronous replication with automatic failover is excellent engineering that provides zero protection against the most common causes of catastrophic data loss, which are human error and malice rather than hardware.

The distinction is that HA protects against things happening to your infrastructure, and DR protects against things happening through it. You need both, and the second one requires copies that are not connected to the first.

Analogy: a bank's vault versus its archive. The vault is high availability: reinforced, alarmed, with a second door — it protects against the building failing. But if the manager mistakenly shreds a ledger, the vault contains a perfectly-protected copy of the shredding. The archive is disaster recovery: a distinct facility, older copies, kept deliberately behind glass so that today's mistake cannot reach yesterday's record. And the property that makes the archive worth anything is not that documents were placed in it, but that somebody has actually retrieved one and confirmed it is readable.


The Two Numbers, Per Data Class

RPO — recovery point objective: how much data you can afford to lose, expressed as time. It equals the age of your most recent usable recovery point, which in practice equals your replication or backup lag.

RTO — recovery time objective: how long you can afford to be unavailable. And the part teams omit:

text

A five-minute restore procedure behind a forty-minute decision is a forty-five-minute RTO. If your alerting takes ten minutes to notice and nobody is authorised to declare a disaster without a director on the call, your real RTO is an hour regardless of how fast the technology is. Measure and state all four terms, because optimising the fastest one is the usual mistake.

Both numbers are business decisions with cost curves, and they must be set per data class rather than once for the whole company:

TierExampleRPORTOMechanism
0payment ledger (P-24)~0minutessynchronous replication + PITR + immutable copies
1primary application databaseseconds–minutes< 1 hourasync replica + PITR
2analytics warehouse (P-22)24 hoursdaysdaily snapshot; rebuildable from source
3derived datan/arebuild timeno backup at all

Tier 3 is the one worth dwelling on, because it is a real and frequently-missed cost saving. Feed timelines (Module A-14), search indexes (Module P-20), vector indexes (Module P-21), caches (Module F-12), and warehouse-derived tables are all rebuildable from a source of truth. Backing them up costs storage and buys nothing except a faster rebuild — and it can be worse than nothing, because restoring a stale derived copy alongside a current source produces inconsistency nobody expects. The correct DR plan for tier 3 is a rebuild procedure with a measured duration, and Module A-14 deliberately designed timelines as a cache for exactly this reason.

The corollary: know which of your data is a source of truth and which is derived. Teams that cannot answer that per dataset back up everything (expensive) or the wrong things (dangerous).


Backup Types, and Point-in-Time Recovery

For Postgres specifically, two families that are not substitutes:

Logical backup (pg_dump). A portable SQL or archive representation. Good for moving between versions, extracting a single table, and long-term archival. Its limits: slow to restore at scale (it re-executes inserts and rebuilds indexes), it is a snapshot of one instant with no ability to recover to a different one, and — the gotcha — roles and cluster-wide objects are not included in a per-database dump, so a restore into a fresh cluster produces a database whose grants refer to users that do not exist (pg_dumpall --globals-only is the missing half).

Physical backup plus WAL archiving. A base backup of the data directory plus a continuous archive of write-ahead log segments, managed by pgBackRest, WAL-G, Barman or your provider. This gives point-in-time recovery, which is the capability that actually saves you:

text

PITR is what turns "we lost three hours of data" into "we lost forty seconds," and it is the difference between a survivable incident and an existential one. It has a specific, silent failure mode:

A broken WAL archive ends your PITR window and produces no error anyone sees. If archive_command starts failing — expired credentials, a full bucket, a changed permission — Postgres keeps running and keeps retaining the un-archived WAL locally (eventually filling the disk), while your recovery window silently stops advancing. Monitor archive success and the age of the newest archived segment as a first-class alarm, alongside Module P-23's replication-slot retention.

Snapshots (block-level, from the storage layer) are fast and cheap and come with two caveats worth knowing. A snapshot of a running database is crash-consistent, not application-consistent — Postgres will recover from it as it would from a power loss, which usually works and is not the same as a verified backup. And snapshots typically live in the same cloud account and often the same region as the volume, which means the same blast radius as the thing they protect: an account compromise or a region loss takes both.

And know your single-table restore story before you need it. PITR restores a whole cluster, so "undo the deletion of one table" means restoring the entire cluster to a side instance at the target time and copying the table across. That is a slow, disk-hungry procedure and it surprises people mid-incident, which is why a periodic logical dump alongside PITR is worth its cost.


Ransomware Changed the Requirements

The classic 3-2-1 rule — three copies, on two media, one offsite — has been extended for a reason:

3-2-1-1-0: three copies, two locations, one offsite, one immutable or air-gapped, and zero verified errors.

The two additions exist because the modern threat model is different. A ransomware operator with access to your environment has your credentials, and the first thing they do is delete or encrypt the backups, because that is what makes the ransom payable. A backup your compromised credentials can delete is not a backup.

What that requires concretely:

Sign in to keep reading

The rest of this module is free — sign in with Google to unlock it and track your progress.

Sign in & Register

Discussion

0

Join the discussion

Loading comments...

© 2026 Jatin Jain Saraf (JJS). All rights reserved.