skip to content

questions

19

A nightly database backup job has reported success every night for six months. What does that success signal actually prove, and what would you do before trusting those backups in a real outage?

level: juniorimportance: must knowfreq 62%

answer

  1. green job = producer, not artifact
  2. untested backup = Schrodinger's backup
  3. restore from the off-site copy
  4. start the engine, then assert on data
  5. time the drill; that is your real recovery time

basics

~20 s

It proves the job ran and wrote bytes somewhere. It does not prove the backup is complete, readable, or restorable. The only proof is restoring it onto a separate instance, starting the database, and querying the data.

solid answer

~50 s

A green backup job is a statement about the **producer**, not the **artifact**. It means a process exited zero. It does not mean the file is complete, that it is uncorrupted, that the encryption key still exists, that the restore procedure still works, or that a restore finishes inside the time budget. Before trusting it I run a restore drill: fetch the backup from the same place a real recovery would fetch it (the off-site copy, not a local scratch directory), restore onto a clean isolated instance, start the database, and run application-level checks - row counts on the biggest tables, the newest timestamp in an append-only table, object counts versus production, and a couple of known business queries. The drill has to be timed and written down: how long it took, how much recent data was missing, and every manual step someone had to improvise. Those numbers are the real recovery capability; the runbook's numbers are only a claim.

go deeper

for a junior

Say plainly that a successful job only proves the job ran, and that the real test is restoring the backup onto a separate machine and checking the data is there and current.

for a middle

Add the mechanics: restore from the off-site copy, start the engine, run row-count and freshness assertions, and time the whole thing. Name concrete silent-failure modes such as backing up a stalled replica or a missing schema.

for a senior

Frame it as evidence generation: cheap verification on every backup, automated restore-and-assert on a schedule, periodic full game days with a rotating operator, and trended timings that feed the recovery-time objective.

for a principal

Talk about it as an organisational control - restorability as a measured, reported property of every data store, with ownership, sampling strategy across a fleet, and an escalation path when a cluster's last successful proof-of-restore ages out.

## The job versus the artifact A backup pipeline has two separable things: the **process** that produces a backup, and the **artifact** that must survive to be used. Monitoring almost always watches the process - exit code, log line, scheduler status - because that is trivially instrumentable. The artifact is what you actually need, and nothing about a zero exit code speaks to it. Real-world failures that coexist happily with six months of green jobs: - The dump ran against a replica that stopped replicating in March, so every backup since then is a snapshot of stale data. - Only one schema was included because the tool's include-list was never updated when a new schema was added. - The archive is written to a volume that silently filled; the tool truncated and still exited zero (or the exit code was swallowed by a shell pipeline). - Bit rot or a bad disk corrupted blocks in the middle of the archive; nothing reads those blocks until a restore does. - The backups are encrypted with a key that lives only on the database host being backed up - the host you just lost. - The restore works but takes 14 hours, and the business promised 1 hour. - Large objects, sequences, or extensions were not captured, so the restored database will not run the application. None of these are exotic. Each is a routine post-incident finding. ## What a restore drill is A restore drill is an end-to-end rehearsal that produces evidence. The essential properties: 1. **Use the real source.** Pull from the off-site or object-store copy through the same credentials and network path a disaster recovery would use. Restoring from a file that is still sitting on the primary proves nothing about the copy that survives the primary. 2. **Restore to an isolated target.** A scratch instance, container, or throwaway cloud host - never anything sharing storage, credentials, or a connection string with production. A restore drill that can overwrite production is a bigger risk than no drill. 3. **Actually start the database.** Recovering files is not recovery. The engine must open the data, replay whatever log it needs, and reach a consistent, writable state. 4. **Validate at the application layer.** The engine starting is a low bar. Check that the newest row in an append-only table is as recent as the backup claims, compare table and index counts against production, verify a few referential-integrity spots, and run two or three queries the application actually issues. 5. **Time everything and record it.** Fetch time, restore time, replay time, validation time, plus every step a human had to figure out live. The gap between the wall-clock total and the target recovery time is your risk. 6. **Have a non-expert drive it.** If only one engineer can execute the runbook, the runbook fails whenever that engineer is asleep or gone. Rotating the operator flushes out undocumented steps faster than any review. ## Cadence and automation An annual drill is theatre. The practical pattern is layered: cheap automated verification on every backup (checksum/manifest validation), an automated restore of at least one cluster per day or per week into a scratch environment with automated data assertions, and a full human-driven game day - including failover, DNS, credentials, and application startup - once or twice a year. Anything you can automate should run unattended and page when it fails, because a drill that requires a person to remember it eventually stops happening. ## What to answer when asked The answer an interviewer wants is short: job success measures the job, not the backup; only a completed restore with data-level assertions and a stopwatch validates a backup; run it regularly, automatically, from the off-site copy, with someone other than the author driving. Then note the second-order point - the drill also produces the only honest measurement of how long recovery takes, which is what the business actually buys.

  • How often would you run restore drills, and does the cadence depend on the system?
    Cheap checks (checksum and manifest verification) run on every backup; an automated restore-and-assert runs at least weekly, and daily for tier-1 systems. A full human game day - failover, credentials, DNS, application startup - happens once or twice a year and after any material change to the backup tooling, storage layout, or schema footprint. Lower-tier systems can drop to quarterly automated restores, but never to zero.
  • What evidence should each drill produce, and where does it go?
    A dated record with: which backup was used, where it was fetched from, wall-clock time for fetch/restore/replay/validation, the data-freshness gap measured against the failure moment, the assertions run and their results, and every manual or undocumented step. Store it where auditors and on-call engineers both look, and trend the timings - a restore that has crept from 20 minutes to 3 hours is a recovery-objective breach nobody declared.

A fire extinguisher with a current inspection sticker. The sticker says someone walked past it, not that it will spray anything when the kitchen is on fire.

saying these in an interview costs you the question

  • Treating a successful backup job or a monitoring green tick as proof the backup is restorable.
  • Validating by checking that the file exists and is roughly the expected size.
  • Doing the drill by restoring the local copy on the database host, which never exercises the off-site path or the credentials a real disaster needs.
  • Restoring but never starting the engine or querying the data, so a structurally broken or stale dataset passes.
  • Not timing the drill, so the organisation never learns that its recovery-time promise is fiction.

context

open as a page

Define Recovery Point Objective (RPO) and Recovery Time Objective (RTO) for a database, and give a concrete example of a system where the two numbers are very different.

level: juniorimportance: must knowfreq 74%

basics

~20 s

RPO is how much recent data you can afford to lose, measured in time before the failure. RTO is how long the system may stay unavailable before it is serving again. RPO is about data loss; RTO is about downtime.

open as a page

Explain the difference between full, incremental, and differential backups of a relational database, and how each choice affects the backup window, storage cost, and restore time.

level: juniorimportance: must knowfreq 58%

basics

~20 s

A full backup copies everything. An incremental copies only what changed since the previous backup of any type. A differential copies everything changed since the last full. Incrementals are smallest to take but slowest to restore, because the whole chain must be replayed.

open as a page

What is point-in-time recovery in a relational database, and what two things must you have been collecting beforehand for it to be possible at all?

level: middleimportance: must knowfreq 58%

basics

~20 s

Point-in-time recovery restores a database to any chosen moment in the past. It needs a base backup of the data files plus an unbroken chain of archived transaction-log records covering everything from the start of that backup onward. You restore the backup, then replay the log and stop at the chosen point.

open as a page

How do the replication commit mode (asynchronous versus synchronous) and the frequency with which write-ahead log segments are shipped off the primary determine the recovery point objective you can honestly promise? What do you pay for a tighter one?

level: middleimportance: must knowfreq 55%

basics

~20 s

Your recovery point equals the newest data that survived the primary. Synchronous commit to another node gives near-zero loss; asynchronous gives loss equal to replication lag; log archiving gives loss up to the archive interval. Tighter costs write latency and couples your availability to the standby.

open as a page

What is the difference between a logical database backup (the kind produced by tools such as pg_dump or mysqldump) and a physical backup (the kind produced by pg_basebackup or Percona XtraBackup), and when would you choose each?

level: middleimportance: must knowfreq 64%

basics

~20 s

A logical backup exports data as SQL statements or rows that must be re-executed to restore. A physical backup copies the database's data files byte for byte. Logical is portable and selective but slow to restore; physical is fast but version- and platform-bound.

open as a page

At 14:32 someone ran an UPDATE without a WHERE clause against the production database. Walk through recovering the database to the state just before that statement.

level: seniorimportance: must knowfreq 56%

basics

~20 s

Stop further writes and preserve the current data and log archive. Identify the exact target just before the statement. Restore the latest base backup taken before 14:32 onto a separate host, replay archived log up to that target, pause and verify, then either cut over to the restored copy or extract the damaged rows back into production.

open as a page

Break down everything that consumes wall-clock time between a database primary dying and the application serving writes again. Which of those components usually dominate, and which can be engineered away?

level: seniorimportance: must knowfreq 50%

basics

~20 s

Detect, decide, fence the old primary, promote or restore, replay logs, repoint clients, warm caches, verify. Detection and human decision usually dominate, then restore and replay if there is no standby. Automation removes detection and decision time; a warm standby removes restore and replay.

open as a page

Explain the 3-2-1 backup rule and how you would apply it to a production relational database. What failure modes do off-site and immutable copies protect against that a second local copy does not?

level: middleimportance: should knowfreq 42%

basics

~20 s

Keep three copies of the data, on two different media or storage systems, with at least one off-site. For a database that means the live cluster, a local or same-region backup repository, and a copy in another region or account - ideally write-once so it cannot be deleted or encrypted by an attacker.

open as a page

Describe the layers of verification you can apply to a database backup, from cheapest to most convincing - for example checksum and manifest verification (as pgBackRest's verify command does) versus a full restore with data assertions. What does each layer catch, and what does each miss?

level: middleimportance: should knowfreq 45%

basics

~20 s

Four layers: metadata checks (file present, size, expected members), checksum and manifest verification of the stored bytes, a restore that starts the engine and replays logs, and application-level assertions on the restored data. Cheap layers catch corruption; only a restore proves recoverability.

open as a page

A recovery can be aimed at a wall-clock timestamp, at a transaction-log position, or at a named marker created earlier. How do you choose between them, and why is a timestamp target less precise than it appears?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Use a log position when you can identify the exact transaction, a named marker when you planned ahead of a risky change, and a timestamp only to narrow a search. Timestamps rely on commit-time clocks, have coarse practical resolution, and cannot separate transactions committing in the same instant.

open as a page

After a database is recovered to an earlier point and then opened for writes, its history forks into a new branch. What does that fork mean for the archived transaction logs, for existing replicas, and for future recoveries?

level: seniorimportance: should knowfreq 32%

basics

~20 s

Promotion starts a new timeline: new log records get a new branch identifier so they do not collide with the abandoned records at the same positions. The old log stays valid for recovering to points on the old branch, replicas that followed the old branch are divergent and must be rebuilt or rewound, and you should take a fresh base backup immediately.

open as a page

Your database backups are encrypted at rest. What can go wrong at restore time because of that encryption, and how do you manage backup encryption keys so a restore is still possible during a real disaster?

level: seniorimportance: should knowfreq 32%

basics

~20 s

An encrypted backup is only as recoverable as its key. Keys stored on the lost host, rotated away, region-pinned, or reachable only through the failed environment make backups unrecoverable. Keep keys in a separate, replicated, escrowed key store, retain old key versions for the backup's lifetime, and prove it by restoring.

open as a page

How would you design a retention and rotation policy for database backups - which tiers to keep, how long to keep each, and how retention interacts with the window over which you can still recover the database to an arbitrary past moment?

level: seniorimportance: should knowfreq 38%

basics

~20 s

Tier it: dense recent backups plus retained log for a fine-grained recovery window (say 7-14 days), then weekly and monthly copies kept for months or years for compliance and slow-burn corruption. Expire the base backup and its dependent log together, and never expire a backup another one depends on.

open as a page

A runbook claims a database recovery point objective of 5 minutes and a recovery time objective of 30 minutes. How would you determine whether those numbers are actually true, and what continuous telemetry would tell you when they stop being true?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Measure, do not assume. Run timed restore and failover drills to get real recovery times, and monitor replication byte lag, archive backlog, and backup age continuously as live proxies for the recovery point. Alert when either exceeds the promised number, and trend restore times against data growth.

open as a page

A nightly logical dump (pg_dump or mysqldump) of a busy production database now runs for hours. What consistency guarantee does such a dump actually give, and what side effects does a long-running dump have on the live system?

level: seniorimportance: should knowfreq 42%

basics

~20 s

A dump is consistent only if it reads inside one long transaction snapshot; otherwise tables are copied at different times. That snapshot blocks cleanup of old row versions, so the database bloats, and the dump also holds locks that block DDL and pollutes the buffer cache.

open as a page

A bad script deleted 200 rows from one table an hour ago, but the rest of the database has taken an hour of valid writes since. How do you get those rows back, and what does that imply about how you size your recovery window?

level: principalimportance: should knowfreq 38%

basics

~20 s

Point-in-time recovery rolls back the whole instance, so do not roll production back. Restore a copy to a scratch instance targeted just before the script, extract the 200 rows logically, and merge them into live data. This costs a full restore, so backup cadence, archive retention and spare restore capacity define what is feasible.

open as a page

How do you decide what recovery point and recovery time objectives a given database should have, when every tightening of those numbers costs money and adds write latency or operational complexity? Walk through how you would tier a portfolio of databases.

level: principalimportance: should knowfreq 30%

basics

~20 s

Derive the numbers from business impact, not engineering taste: what a minute of downtime and a minute of lost data cost, and whether the data is reconstructible elsewhere. Then define three or four standard tiers with fixed architectures and prices, and make owners choose a tier and fund it.

open as a page

You own a 4 TB relational OLTP database with a two-hour nightly low-traffic window. Design its backup strategy in terms of backup types, and explain the tradeoffs behind your choices.

level: principalimportance: should knowfreq 30%

basics

~20 s

Physical backups are the base: a weekly full plus daily block-level incrementals, because a 4 TB logical dump will not fit a two-hour window. Add a periodic logical dump for portability and object-level recovery, keep copies off-site, and size retention around how far back you must be able to go.

open as a page