Backups, RPO, RTO and multi-region

Cloud, deploys and infrastructure Senior Python 3.13+ PostgreSQL 17+ Reviewed By Best Latest Apps

Predict the output

What are the two RPOs?

Python 3.13
backup_every_min = 60
replication_lag_s = 5
print("RPO with hourly backups only:", backup_every_min, "min")
print("RPO with a streaming replica:", replication_lag_s, "s")

Options
Hint 1 of 1

What's the most you could lose with each?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A 60 min and 5 s

Correct. You can lose up to one backup interval, or up to the replica's lag.

RPO is how much recent data you can lose. With hourly backups it can be up to an hour; a streaming replica loses only what hadn't replicated yet, about its lag.

Why not the others?
  • B 0 min and 0 s. Asynchronous copies always lag a little.
  • C 5 min and 60 s. Swapped.
  • D 60 min and 60 min. Streaming replicas are much closer.

30-second answer

Start from two targets: RPO, how much recent data you can afford to lose, and RTO, how long you can be down. Hourly backups alone mean an RPO of up to an hour; continuous WAL archiving or a streaming replica brings it to seconds. Test restores regularly, because an untested backup is a hope. Multi-region active-passive gives fast failover; active-active adds conflict handling and is much harder.

Practise saying it · 30 s. No recording, just a timer

Plan DR.

Say your answer out loud, then check which of these points you covered:

  • RPO and RTO
  • Backups + WAL / PITR
  • Test restores
  • Replicas aren't backups
  • Active-passive regions

Deep dive

Point-in-time recovery replays WAL to any moment, useful after a bad DELETE.

Keep backups in another account or region, and immutable, against ransomware and mistakes.

Measure RTO in drills, not on paper.

Replicas copy mistakes instantly; they're not backups.

Recovery point for two set-ups Ran on Python 3.13.5 · mypy --strict
Python 3.13
backup_every_min = 60
replication_lag_s = 5
print("RPO with hourly backups only:", backup_every_min, "min")
print("RPO with a streaming replica:", replication_lag_s, "s")

Common mistakes

  • Never testing restores.
  • Treating a replica as a backup.
  • Backups in the same account as production with delete rights.

Senior take & follow-ups

Define RPO and RTO, match techniques to them, test restores, then regions.

Follow-up questions

Think of your answer first, then open the hint.

  1. Is a replica a backup?

    Show hint

    No; a DROP TABLE replicates too.

  2. How do you recover from a bad DELETE at 14:02?

    Show hint

    Point-in-time restore to 14:01 and copy the rows back.

Suggest a fix if something here is wrong or out of date.