Quick revision
The short answer
We set up automated restore tests that regularly restore the 4 TB database into a scratch environment and validate it with row counts, checksums and an application smoke test, recording how long each restore takes, because that measured time is our real RTO for backup-based recovery. To shorten it we move to incremental or differential backups with parallel restore (pgBackRest for PostgreSQL, MySQL Enterprise Backup or Percona XtraBackup for MySQL). Backups go to another account and region, immutable and encrypted, with keys recoverable separately, and we alert on backup failures and WAL archive gaps, which silently break point-in-time recovery.
What to remember
In this answer, we saw that a successful backup job proves little, so we automate regular restores into a scratch environment, validate them with counts, checksums and a smoke test, and record the duration as our real RTO. We shorten restores with incremental or differential backups and parallel restore, protect backups with a separate account and region, object lock and separately recoverable keys, and alert on backup failures and WAL archive gaps.
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.
We set up automated restore tests that regularly restore the 4 TB database into a scratch environment and validate it with row counts, checksums and an application smoke test, recording how long each restore takes, because that measured time is our real RTO for backup-based recovery. To shorten it we move to incremental or differential backups with parallel restore (pgBackRest for PostgreSQL, MySQL Enterprise Backup or Percona XtraBackup for MySQL). Backups go to another account and region, immutable and encrypted, with keys recoverable separately, and we alert on backup failures and WAL archive gaps, which silently break point-in-time recovery.
Why this question is asked
A backup that has never been restored is a hope, not a backup. Audits find this situation often, because backups are configured once, the job reports success every night, and nobody checks whether the files could actually rebuild the database or how long that would take. For a 4 TB database, the answer might be twenty hours, which is a business decision nobody made. Interviewers ask this to see whether we treat recovery as something to prove and measure. In this answer, we will automate restore tests, decide how to validate a restored copy, turn the measured duration into an RTO, speed restores up, protect the backups themselves and set up the alerts that catch silent failures.
1Why a Successful Backup Job Proves So Little
A backup job reporting success only tells us that it copied some files somewhere. It does not tell us that every file needed is present, that the WAL archive has no gaps, that the encryption key still exists, that the backup tool version can still read the format, or that a restore fits in the time the business expects. Each of these has caused real incidents where a team discovered, during an outage, that its backups were useless.
So the goal is to turn the backup into evidence: a restore that ran recently, completed, passed checks and took a known amount of time.
2Automated Restore Tests
We schedule a restore test, for example weekly for this database, that runs without humans. It provisions a scratch server or a disposable cloud instance, restores the latest backup plus WAL to a recent point in time, runs validation, records the results and tears the environment down. Running it on a schedule matters more than running it perfectly, because the results tell us when something changes.
- Provision a scratch instancesame version and storage class as production
- Restore latest full and incrementalstime the restore
- Replay WAL to a recent targettime the replay
- Run validation queriescounts, checksums, smoke test
- All checks passed?YesRecord duration and passNoAlert the database team
- Tear down the instancekeep logs and metrics
6 steps in order. Play them, or step through them one at a time.
3Validating the Restored Copy
A database that starts is not necessarily a correct database. We compare it with known facts. Row counts of key tables should match what production had at the target time, within the writes of the last few seconds, which we can capture from production at backup time. Checksums or aggregates over stable data, such as the sum of closed invoice totals for last month, catch silent corruption. Data checksums, if enabled in the cluster, can be verified across all pages with pg_checksums on the stopped copy, or by tools such as pgBackRest during backup.
The application smoke test is the final check: a small set of read-only requests, such as loading a customer, listing orders and rendering an invoice, proves that schemas, extensions and permissions came back too, not just the data.
4The Measured Duration Is the Real RTO
Each test records how long it took, split into restoring files and replaying WAL. Suppose the first test takes 9 hours: 6 hours to restore 4 TB at about 190 MB/s from object storage, and 3 hours to replay a day of WAL. That number is now our RTO for any recovery that needs backups, such as corruption, a destroyed cluster or a bad migration replicated to every standby.
Then we hold it against the business's expectation. If the business assumed one hour, there is a gap to report as a risk and to close. Notice that standbys do not remove this number. They protect against server failure, but a bad DELETE or a corrupting bug is replicated to them instantly, so backups remain the only way back from those.
5Making Restores Faster
Two things dominate restore time: how much data must be copied and how much WAL must be replayed. Incremental and differential backups attack the second. pgBackRest takes a weekly full backup and daily differential or incremental backups, so the latest backup is never more than a day old and replay covers hours, not days. On MySQL, Percona XtraBackup and MySQL Enterprise Backup offer incremental backups of InnoDB. PostgreSQL 17 also added native incremental backups with pg_basebackup --incremental and pg_combinebackup, check your version.
Parallelism attacks the first. pgBackRest's process-max runs many restore processes at once, compression trades CPU for less transfer, and delta restore reuses files that are already present on the target. Storage choices matter as much: restoring onto fast local disks and from storage in the same region can turn 190 MB/s into 800 MB/s or more. With a daily differential and 16 parallel processes, our 9 hours might fall to 2.
6Protecting the Backups Themselves
Backups must survive the events they exist for, including an attacker or a mistaken script with access to the production account. So we store them in a separate cloud account and region, with object lock, write-once storage that cannot be deleted or changed until a retention date, ideally in compliance mode where even administrators cannot shorten it. They are encrypted, and the encryption keys are stored and recoverable separately, because a backup encrypted with a key that was deleted along with the production account is just noise.
Finally, we alert on everything that can silently break the chain: a failed or missing backup run, a backup that takes far longer than usual, and especially WAL archive failures. pg_stat_archiver's failed_count, or the backup tool's own check command, shows archiving trouble. A single missing WAL segment makes point-in-time recovery impossible past it, and without an alert nobody would know until the day we need it.
7Follow-up questions
How often should the restore test run?
Often enough that a broken backup is found before it is needed. Weekly is a good default for important databases, daily for the most critical, and at least monthly for the rest. The point is that the result is never older than the window we are willing to be blind for.
Do restore tests cost a lot?
A scratch instance for a few hours per week, plus data transfer, is usually a small fraction of the database's running cost. Compared with discovering during an incident that backups do not work, it is very cheap.
Should restores also be tested by people?
Yes, at least a couple of times a year. Automation proves the backups; a human drill proves that the on-call engineers know the runbook, have the access they need and can make decisions under pressure, which automation cannot.
8Conclusion
In this answer, we saw that a successful backup job proves little, so we automate regular restores into a scratch environment, validate them with counts, checksums and a smoke test, and record the duration as our real RTO. We shorten restores with incremental or differential backups and parallel restore, protect backups with a separate account and region, object lock and separately recoverable keys, and alert on backup failures and WAL archive gaps.
Open with
I would treat this as missing evidence and fix it in a few steps. First, an automated restore test, weekly for this database: it provisions a scratch instance with the same version, restores the latest backup and replays WAL to a recent point, then validates.
Then, if they want more
Validation means row counts of key tables against numbers captured at backup time, aggregates like last month's invoice totals as checksums, data checksum verification, and a read-only smoke test of the application against the copy.
Second, I would record how long the restore and replay take, because that is our real RTO for any recovery that needs backups, like corruption or a bad migration that replicated to every standby. If it is nine hours and the business assumed one, that is a risk to report.
Third, I would cut the time: weekly full plus daily differential or incremental backups with pgBackRest, or XtraBackup or MySQL Enterprise Backup on MySQL, parallel restore with process-max, compression, and fast storage, which can bring nine hours down to two.
Fourth, I would protect the backups: another account and region, object lock in compliance mode, encryption with keys that are recoverable separately. And finally, alerts on failed or slow backups and on WAL archive gaps, because one missing segment silently breaks point-in-time recovery.
About this answer
- Last updated
- 12 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 documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
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 "An audit finds that your nightly backups have never been restored, and nobody knows how...": https://scrivio-interview-library.netlify.app/databases/replication-and-ha/b7209445e8/