Quick revision
The short answer
The claim counts only the snapshot restore and leaves out detection and the decision to restore, replaying logs up to the target time, slow disks right after a snapshot restore, validation, reconnecting services, warming caches and reprocessing queued work. A realistic recovery takes two to three hours, so the team should measure it in a drill and publish the measured figure. The real RPO is set by what had been copied off the server when it failed: with logs archived every 5 minutes, up to 5 minutes of writes are lost; with nightly backups alone, up to a day.
What to remember
In this answer, we saw that a one-hour RTO based on a 40-minute snapshot restore leaves out detection and decision, log replay, slow disks after restore, validation, reconnection, cache warming and reprocessing, so the real figure is likely two to three hours and must be measured in a drill. We also saw that RPO is set by what was copied off the server: the WAL archiving interval or the nightly backup.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The claim counts only the snapshot restore and leaves out detection and the decision to restore, replaying logs up to the target time, slow disks right after a snapshot restore, validation, reconnecting services, warming caches and reprocessing queued work. A realistic recovery takes two to three hours, so the team should measure it in a drill and publish the measured figure. The real RPO is set by what had been copied off the server when it failed: with logs archived every 5 minutes, up to 5 minutes of writes are lost; with nightly backups alone, up to a day.
Why this question is asked
RTO and RPO numbers often come from the one step people have timed, and the restore command is the step everyone remembers. But customers are not served again when the restore command finishes; they are served when the whole system works. Interviewers ask this question to see whether we can break a recovery into its real stages and give honest numbers. In this answer, we will recap RTO and RPO, then walk through a realistic recovery of the 2 TB order database stage by stage, add up the time, see how to shorten it, and finish with what decides the RPO.
1A Quick Recap of RTO and RPO
The recovery time objective, RTO, is the longest acceptable time from the start of an outage to restored service. The clock starts when the database fails, not when someone starts the restore. The recovery point objective, RPO, is the most data we may lose, measured in time: how far back the restored data may be from the moment of failure.
So an RTO of one hour is a promise that customers can place orders again within one hour of the failure. To check the team's claim, we have to count every stage between those two moments.
2Stage 1: Detection and Decision
Before any restore, someone has to notice. Alerts fire after a threshold, often a few minutes of errors. The on-call engineer wakes up, logs in and investigates. Then comes the decision: is this something we can repair, such as restarting the database or failing over to a replica, or do we really need to restore from a snapshot? Restoring discards anything after the restore point, so people are rightly careful.
Together, detection and decision often take 15 to 45 minutes, and longer at night or when nobody is sure who may approve a restore. A pre-agreed rule, such as restore if the primary and replica are both unusable for 10 minutes, shortens this stage a lot.
3Stage 2: The Restore Is More Than the Snapshot
The 40-minute snapshot restore brings back the database as it was when the snapshot was taken, perhaps hours before the failure. To get closer to the failure, we replay the write-ahead log, PostgreSQL's record of every change, or MySQL's binary logs, from the snapshot up to the target time. On a busy 2 TB order database, replaying several hours of changes can take as long as the restore itself, so another 30 to 60 minutes.
There is another catch. Disks created from cloud snapshots often load their blocks lazily from object storage the first time each block is read. Until the data is loaded, reads are much slower, so the database can be up but sluggish for a while, and log replay itself is slowed down. Some providers offer a faster initialisation option at extra cost.
4Stage 3: Validation and Reconnection
A restored database is not yet a working service. We check that it is correct: row counts on key tables, the most recent orders, a few known transactions. Then services must point at the new endpoint, which may mean a DNS change, a configuration update and rolling restarts. Caches that hold data from the lost database may need to be cleared, and caches that were empty need to warm up. Messages that queued up while the database was down, such as orders waiting in Kafka, must be reprocessed.
These steps are each short, but together they easily take 20 to 30 minutes, and they are rarely rehearsed.
| Stage | Estimate | What shortens it |
|---|---|---|
| Detection and decision | 15 to 45 min | Better alerts, pre-agreed restore rule |
| Snapshot restore | 40 min | Faster disk initialisation, smaller databases |
| Log replay to target time | 30 to 60 min | More frequent snapshots, less log |
| Validation | 10 to 15 min | Scripted checks |
| Reconnect, warm caches, replay queues | 15 to 30 min | Automation, rehearsal |
| Total | About 2 to 3 hours | Measure it in a drill |
5Measure It, Then Shorten It
Adding the stages gives a realistic RTO of two to three hours, not one. The honest step is to run a drill: restore the real backup to a separate environment, time every stage, and publish the measured figure. Then the business can decide whether two and a half hours is acceptable or worth paying to shorten.
Each slow stage has a lever. Faster detection and a pre-approved decision cut the first stage. More frequent snapshots leave less log to replay. A standby replica that can be promoted avoids the restore entirely for most failures, keeping restores for corruption and disasters. Scripts for validation and reconnection remove the slow manual steps.
6What Decides the Real RPO
The RPO is not set by the restore at all. It is set by what had been copied off the server when it failed. If WAL segments are archived to object storage every 5 minutes, then up to 5 minutes of writes since the last archived segment can be lost when the server dies. If only nightly backups exist, everything since last night, up to a day of orders, can be lost.
So the team should state both numbers from evidence: the RTO from a timed drill, and the RPO from the archiving interval, plus replication lag if a replica is the first line of defence.
7Follow-up questions
How would continuous archiving of the write-ahead log change both numbers?
Continuous archiving, for example with pgBackRest or WAL-G streaming each WAL segment to object storage as soon as it is complete, or with archive_timeout set to force a segment switch every minute, shrinks the RPO from the archive interval to about a minute or less, and streaming the WAL in real time can bring it to seconds. For RTO it helps indirectly: the log is always available, so we can restore to any point. But replay time still depends on how much log lies between the last base backup and the target, so frequent base backups or incremental backups are what keep the RTO down.
Why not rely on a replica instead of backups?
For hardware or zone failures, a replica is the faster path and should be the first choice. But a replica copies mistakes and corruption immediately, so backups with point-in-time recovery are still needed for those cases.
What does a drill need to include to be meaningful?
A restore of the real production backup, at production size, by the people who would be on call, including the decision step, the log replay and reconnection, timed end to end.
8Conclusion
In this answer, we saw that a one-hour RTO based on a 40-minute snapshot restore leaves out detection and decision, log replay, slow disks after restore, validation, reconnection, cache warming and reprocessing, so the real figure is likely two to three hours and must be measured in a drill. We also saw that RPO is set by what was copied off the server: the WAL archiving interval or the nightly backup.
Open with
The claim only counts the snapshot restore, but RTO runs from the moment the database fails until customers are served again. First comes detection and decision: alerts fire, someone wakes up, investigates and decides that a restore is needed rather than a repair.
Then, if they want more
That is often 15 to 45 minutes, longer at night without a pre-agreed rule.
Then the restore itself: 40 minutes brings back the snapshot, but to get close to the failure we replay write-ahead logs up to the target time, which on a busy 2 terabyte database can take as long again, and disks restored from cloud snapshots can be slow until their blocks are loaded.
After that, validation, checking counts and recent orders, then pointing services at the new endpoint, warming caches and reprocessing queued messages. Adding it up, the real RTO is likely two to three hours.
I would run a drill, time every stage, publish the measured number, and shorten the slow stages with better alerting, a pre-approved restore decision, more frequent snapshots so there is less log to replay, and scripted validation and reconnection. The RPO is a separate question: it is set by what had been copied off the server when it failed.
If WAL is archived every 5 minutes, we can lose up to 5 minutes of writes; with nightly backups only, up to a day.
About this answer
- Last updated
- 13 November 2026
- Versions it names
- PostgreSQL 17
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. 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 "What does this claim leave out? Break a realistic recovery into its stages, estimate...": https://scrivio-interview-library.netlify.app/architecture/high-availability/317ed603bf/