Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

Define RPO and RTO and give realistic values for these three setups: nightly pg_dump only; base backups with WAL archiving; synchronous standby with automated failover.

RPO, the recovery point objective, is the maximum data loss we accept, measured in time; RTO, the recovery time objective, is the maximum time until service is restored. A nightly pg_dump gives an RPO of up to 24 hours and an RTO of hours, mostly for restoring data and rebuilding indexes. Base backups with WAL archiving bring RPO down to seconds or minutes, bounded by the last archived segment and archive_timeout, with an RTO of an hour or more for a large database. A synchronous standby with automated failover gives RPO near zero for acknowledged commits and an RTO of tens of seconds to a few minutes, but all of these numbers must be measured in drills.

Why this question is asked

RPO and RTO are the two numbers that turn a vague wish, we must not lose data, into something we can design and test. Every backup and replication decision trades between them and cost. Interviewers ask for realistic values for concrete setups because many engineers know the definitions but cannot say what a nightly dump actually means for the business, or why a 2 TB restore takes hours. In this answer, we will define both terms with an example, then work out realistic numbers for each of the three setups, compare them side by side, and see why only measured numbers count.

1Defining RPO and RTO

Picture a timeline with a disaster in the middle. Looking backwards from the disaster, RPO, the recovery point objective, is how far back in time our recovered data may be. An RPO of 15 minutes means that after recovery, we may have lost at most the last 15 minutes of changes. Looking forwards from the disaster, RTO, the recovery time objective, is how long until the service works again. An RTO of one hour means users may be unable to work for up to an hour.

The two are independent. A system can have a tiny RPO and a long RTO, for example perfect WAL archives that take six hours to replay, or a short RTO and a large RPO, such as a quick restore of yesterday's dump. The objective is the target; what a setup achieves is its actual recovery point and time, and the job is to make the actual numbers meet the targets.

2Setup 1: Nightly pg_dump Only

A nightly pg_dump is a logical snapshot taken, say, at 01:00. If the database is lost at 23:00, the newest copy is from 01:00, so 22 hours of changes are gone. In the worst case, just before the next dump, the loss is close to 24 hours. That is the RPO: up to 24 hours. And if the dump job silently failed last night, it is 48.

The RTO is hours. Restoring a dump means creating a fresh server, loading every table's rows with pg_restore, then building every index and validating every foreign key from scratch, because a logical dump contains definitions, not physical index files. For a 500 GB database, loading might take two or three hours and index builds another two or more, even with pg_restore --jobs running several in parallel. Add provisioning and checking, and four to eight hours is realistic.

Text
pg_dump -Fc -f /backups/shop_2026-11-05.dump shop # 01:00, logical snapshot
# disaster at 23:00
createdb shop
pg_restore --jobs=8 -d shop /backups/shop_2026-11-05.dump # rows, then indexes and constraints
# data as of 01:00: 22 hours of orders are gone

3Setup 2: Base Backups With WAL Archiving

Here we keep physical base backups, for example nightly, and archive every WAL segment as it fills. Recovery restores the base backup and replays WAL up to the newest archived segment. What we lose is only the WAL that had not been archived yet when the disaster hit: the current, partially filled segment. On a busy server, a 16 MB segment fills in seconds, so the loss is seconds. On a quiet server, a segment may take an hour to fill, so archive_timeout forces a switch, for example every 60 seconds, bounding the loss at about a minute. Tools such as pgBackRest or Barman can also stream WAL continuously to shrink it further.

The RTO is the time to restore the base backup plus the time to replay a day of WAL. For a 2 TB database restored at 300 MB/s, the copy alone takes about two hours, and replay adds anything from minutes to hours depending on write volume. So an hour or more for large databases is typical, and that is why this setup is usually combined with a standby for faster recovery from server failure, keeping PITR for corruption and operator mistakes.

4Setup 3: Synchronous Standby With Automated Failover

With a synchronous standby, every commit waits until the standby has the WAL on disk before the client is told it succeeded. If the primary dies, every acknowledged transaction already exists on the standby, so RPO is effectively zero for acknowledged commits. Transactions in flight at the moment of the crash were never confirmed, so their clients get an error and retry.

With a failover manager such as Patroni, the RTO is detection time plus promotion plus redirection: typically 10 to 30 seconds to be sure the primary is gone, a few seconds to promote, and a few more for DNS, a proxy or a virtual IP to point at the new primary. Tens of seconds to a few minutes, including the application reconnecting.

But there is a catch: this setup protects only against losing the primary. A bad DELETE or a corrupting bug is replicated to the standby instantly, so for those failures its RPO and RTO are those of whatever backups we have. That is why real systems combine setups 2 and 3.

5Comparing the Three Setups

Side by side, the trade-off between protection and cost is easy to see.

Realistic RPO and RTO
SetupRPORTOProtects against
Nightly pg_dumpUp to 24 hHours (load + index builds)Loss of everything, slowly
Base backup + WAL archiveSeconds to ~1 min1 h or more for TBsLoss, corruption, bad changes (PITR)
Sync standby + auto failover~0 for acknowledged commitsTens of s to a few minServer or zone failure only
Real systems combine the last two: the standby for speed, PITR for mistakes.

6Why the Numbers Must Be Measured

Every figure above is an estimate based on typical hardware and volumes. The real numbers depend on our data size, our storage throughput, our write volume and our people. A restore that should take two hours takes seven because the backup bucket is in another region; a failover that should take 30 seconds takes 12 minutes because the application has no socket timeouts. So the values are only real once we measure them in drills, restoring backups and forcing failovers on a schedule and recording the actual recovery point and time.

7Follow-up questions

Is RPO measured in time or in transactions?

It is defined in time, because that is how the business thinks: how many minutes of orders could we lose. But it is useful to translate it into volume for the conversation, for example 60 seconds of RPO at peak means up to 3,000 orders that might need to be recreated.

Does a synchronous standby make backups unnecessary?

No. The standby copies deletions, corruption and bad migrations instantly. Backups with WAL archiving are the only way back to a moment before such a mistake, so we need both.

What does archive_timeout cost?

Each forced switch archives a full 16 MB segment even if it is mostly empty, though compression shrinks those well. With 60 seconds that is up to about 23 GB a day before compression on an idle server, which is usually acceptable, but very low values multiply storage.

8Conclusion

In this answer, we defined RPO as the maximum acceptable data loss in time and RTO as the maximum time to restore service. A nightly pg_dump gives up to 24 hours of RPO and hours of RTO, base backups with WAL archiving give seconds to a minute of RPO with an RTO of an hour or more for large databases, and a synchronous standby with automated failover gives near-zero RPO and an RTO of seconds to minutes for server failure only. All of them must be confirmed by measuring in drills.

What to say in the interviewAbout 90 seconds aloud

Open with

RPO, recovery point objective, is how much data we can afford to lose, measured as time before the failure. RTO, recovery time objective, is how long we can be down before service is back.

Then, if they want more

With only a nightly pg_dump, the newest copy can be almost a day old, so the RPO is up to 24 hours, more if a dump failed. The RTO is hours, because pg_restore has to load all the rows and then rebuild every index and constraint; for a few hundred gigabytes, four to eight hours is realistic.

With base backups plus WAL archiving, we only lose WAL that was not archived yet, so seconds on a busy system, and archive_timeout, say 60 seconds, bounds it on a quiet one. The RTO is restoring the base backup plus replaying WAL, often an hour or more for a terabyte-scale database.

With a synchronous standby and automated failover like Patroni, acknowledged commits are already on the standby, so the RPO is near zero, and the RTO is detection plus promotion plus redirection, tens of seconds to a couple of minutes. But the standby replicates mistakes instantly, so for a bad DELETE you still rely on PITR.

I would combine the last two, and I would stress that all these numbers are estimates until we measure them in restore and failover drills.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Define RPO and RTO and give realistic values for these three setups: nightly pg_dump...": https://scrivio-interview-library.netlify.app/databases/replication-and-ha/e1cc544493/