Backup and Disaster Recovery Questions
Keeping data durable and recoverable when systems fail: backup design (full, incremental, differential, and snapshot strategies; point-in-time recovery), backup verification and restore testing, retention and archival policy (including compliance retention and legal holds), encryption and key management for backups, and disaster-recovery planning measured against recovery-time and recovery-point objectives (RTO/RPO). Tests whether a candidate can design a backup strategy that actually restores, choose the right retention tier for a business's downtime and data-loss tolerance, and operate backup systems safely under failure, compliance, and ransomware threats. Distinct from code-level fault-tolerance patterns (circuit breakers, retries, bulkheads) and multi-region failover architecture, which belong to high-availability-and-disaster-recovery.
Design a disaster recovery strategy for a transactional relational database requiring RPO < 1 minute and RTO < 15 minutes across regions. Describe replication method, failover procedure, data consistency considerations, and how to test DR with minimal production impact.
Sample Answer
Direct answer
RPO (Recovery Point Objective: the maximum data-loss window) under 1 minute is tight enough to change the design decision compared to a looser target: at this ceiling, asynchronous replication's typical seconds-level lag is often fine in practice, but it isn't a guaranteed bound, replication lag can spike well past a minute under load or a network hiccup with nothing stopping it. Meeting RPO < 1 minute as an actual guarantee, not just a usual outcome, points toward synchronous or quorum-based replication (the primary waits for acknowledgment from the standby, or from a quorum of standbys, before committing), accepting the added write latency that comes with it as the deliberate cost of the guarantee.
Structured elaboration
Replication method. Synchronous replication (e.g. Postgres synchronous_commit=on or remote_apply) gives RPO effectively zero for infrastructure failures, since no commit is acknowledged to the client until the standby has it, but adds the cross-region round-trip time (commonly tens to over a hundred milliseconds depending on the region pair) to every write, which can become a real throughput constraint under high transaction rates. Quorum-based replication (a write is acknowledged once a quorum, e.g. 2 of 3 regional replicas, has it, not all of them) gives the same strong guarantee while tolerating one slow or unreachable replica without stalling the primary. A well-monitored asynchronous setup, with alerting on lag well inside the 1-minute budget, is a real option only if the business explicitly accepts "usually under a minute, not contractually guaranteed under adverse conditions"; that trade-off should be surfaced explicitly rather than silently assumed away by picking async and hoping.
Failover procedure and RTO budget. Detection (confirmed failure, not a single blip): roughly 2 minutes. Promotion: roughly 3 minutes, faster than a looser-RPO design because a synchronous or quorum replica is, by construction, already caught up and doesn't need catch-up time before it's safe to promote. Traffic cutover: roughly 5 minutes, requiring a short DNS TTL (time-to-live, how long clients cache a DNS record before re-checking it) set in advance (e.g. 30 to 60 seconds) plus application-level reconnect/retry behavior that doesn't require a manual restart. Validation smoke test before declaring recovery: roughly 3 minutes. Summed: roughly 13 minutes, leaving about 2 minutes of margin under the 15-minute RTO (Recovery Time Objective: the maximum downtime) target, all figures illustrative and meant to be re-timed in a real drill, not asserted as guaranteed.
Data consistency considerations. With synchronous or quorum replication, the promoted standby is guaranteed consistent up to the last acknowledged commit, so failover requires no reconciliation, the biggest consistency advantage over asynchronous replication. The real risk with any replication mode is the old primary coming back online after failover with writes the new primary never received (a split-brain divergence): it has to be explicitly fenced (its ability to accept writes revoked) the moment failover is declared, and any writes it accepted after the split should be treated as lost or requiring manual reconciliation, not silently merged back in.
Testing DR with minimal production impact. Promote a replica into an isolated network segment for drills, not the live traffic path, so testing the mechanics of failover never touches real user traffic. Validate the promoted instance with synthetic or replayed read-only traffic, or a canary write workload against a namespaced test schema, rather than pointing real users at it. To test the cutover mechanism itself (DNS or routing changes) without customer impact, use a small canary percentage of traffic, or hit the DR region's endpoint directly with an internal synthetic client, bypassing the global router that serves real users, so the target environment is validated without touching what actually routes production. Time every phase of each drill against the 15-minute budget and update the runbook if any phase trends over its allotted share.
Given a business tolerance of maximum 2 hours downtime and 1 hour data loss for core services, design a backup and disaster recovery (DR) policy. Define RTO and RPO for key services, replication strategy, failover automation, recovery testing cadence, and cost trade-offs.
Sample Answer
Direct answer
RTO (Recovery Time Objective, maximum acceptable downtime) and RPO (Recovery Point Objective, maximum acceptable data loss measured as time) for the core services map directly from the stated business tolerance: RTO <= 2 hours, RPO <= 1 hour. The useful next step is recognizing that not every service in the estate deserves that same investment. A reporting database that feeds executive dashboards is a good concrete example of a service that looks similar on paper but has a much looser real tolerance, and tiering the policy by actual business need, rather than applying the tightest tier everywhere, is what makes the cost trade-off defensible.
Structured elaboration
Defining RTO and RPO for key services. RTO is the wall-clock time from an outage starting to the service being usable again; the business's stated "maximum 2 hours downtime" becomes the RTO target for core services directly. RPO is the maximum span of committed data the business can afford to lose, measured backward from the moment of failure; "maximum 1 hour data loss" becomes the RPO target for core services directly. These targets apply to the core, revenue- or customer-facing services; not every service in the estate needs to meet them, which is the next point.
Tiering example, folding in the reporting-database case. Tier 1 (core, e.g. the primary transactional order database): RTO <= 2 hours, RPO <= 1 hour, per the stated business tolerance, requiring cross-region replication and automated failover. Tier 2 (example: a reporting database serving executive dashboards): a much looser target is legitimate here, because the data is derived from Tier 1 via a nightly ETL job (extract-transform-load, the scheduled job that pulls and reshapes data into the reporting database) and consumed by internal stakeholders who can tolerate a stale dashboard for a day. A reasonable Tier 2 target is RTO of roughly 24 hours and RPO of roughly 24 hours, matching the dashboard's own normal refresh cadence: "restoring" it really means rerunning the ETL job a bit early against the already-recovered Tier 1 database, not maintaining a separate cross-region replica for the reporting database itself. Note the RPO basis explicitly: it's bounded by the ETL's refresh interval, not by continuous replication, so promising a tighter RPO than the pipeline's own cadence would be meaningless without also increasing how often the pipeline runs.
Replication strategy. Tier 1: asynchronous cross-region log shipping (e.g. WAL, the write-ahead log), sized so typical replication lag stays well under the 1-hour RPO ceiling with margin; since real-world lag is usually seconds to low minutes, synchronous replication's write-latency cost isn't justified for a 1-hour target. Tier 2: no dedicated replication is needed at all; "replication" for the reporting database really means keeping its Tier 1 data source protected, plus keeping the ETL job's definition and schedule version-controlled so it can be rerun from anywhere.
Failover automation. Tier 1: automated health checks trigger promotion of a standby, repoint the client-facing endpoint, and run a smoke test, budgeted to sum to the 2-hour ceiling with an explicit buffer: detection roughly 15 minutes, promotion roughly 15 minutes, endpoint cutover and propagation roughly 30 minutes, validation roughly 30 minutes, buffer roughly 30 minutes, totaling 120 minutes exactly against the 2-hour target. Tier 2: a scripted but human-triggered rerun of the ETL job against the recovered Tier 1 primary is sufficient; full automation investment isn't justified given the looser RTO.
Recovery testing cadence. Tier 1: quarterly full DR game days, measuring real RTO and RPO against target end to end. Tier 2: semi-annual validation is sufficient, and is effectively re-exercised for free every time the ETL job is rerun ad hoc for any operational reason, given the lower business criticality.
Cost trade-offs, with a worked example. Tier 1's targets require paying for cross-region infrastructure continuously: a standby instance running around the clock, plus replication egress. If the Tier 1 database generates roughly 5 GB/hour of WAL and cross-region egress costs roughly $0.02/GB, monthly replication egress is roughly 5 GB/hr x 24 hr x 30 days x $0.02/GB = 3,600 GB x $0.02 = about $72/month (an illustrative estimate, not a real bill, meant to show the shape of the calculation). The reporting database's Tier 2 posture costs effectively nothing extra in dedicated DR infrastructure, since it has no dedicated replica; its only cost is the ETL job's normal query load, which it already pays regardless of DR posture. The general principle: DR spend should scale with each service's actual business tolerance, not be applied uniformly at the tightest tier's cost everywhere, or you end up paying continuous cross-region replication costs to protect data, like daily dashboard aggregates, that nobody actually needs back in under 24 hours.
Define Recovery Time Objective (RTO) and Recovery Point Objective (RPO). Then give two practical examples mapping specific RTO and RPO values to backup types and frequencies: one for a small e-commerce transactional database, and one for a log or analytics pipeline where some data loss is acceptable.
Sample Answer
Direct answer
Recovery Time Objective (RTO) is the maximum acceptable length of time between a failure or data-loss event and the moment the affected system is back up and functioning normally: it answers "how long can we tolerate being down." Recovery Point Objective (RPO) is the maximum acceptable amount of data loss, measured as a span of time between the last valid recoverable state and the moment of failure: it answers "how much recent data can we afford to lose." Both are business decisions first (driven by what downtime or data loss actually costs the business) that then drive the technical backup design, not numbers an engineering team should invent unilaterally. Below are two worked examples that map specific RTO/RPO values to specific backup types and frequencies, one for a small, low-volume e-commerce transactional database, and one for a log or analytics pipeline where some data loss is tolerable.
Structured elaboration
Recovery Time Objective (RTO). Measured on the downtime axis. If a database goes down at 2:00pm and the RTO is 1 hour, the business has committed to being back online by 3:00pm at the latest. RTO is achieved through how fast you can restore or fail over, not through how often you back up.
Recovery Point Objective (RPO). Measured on the data-loss axis. If the last successful backup or log-shipment happened at 1:55pm and the database fails at 2:00pm, you've lost 5 minutes of writes: an RPO of 5 minutes means that gap is the maximum you've committed to tolerating. RPO is achieved through how frequently you capture recoverable state (backup cadence or continuous log shipping), not through restore speed.
Example 1: small e-commerce transactional database. Context: an online store taking live customer orders and payments continuously, at a modest volume, say roughly 200 orders/day on average (this is stated as a daily average for illustration; actual peak-hour order rate would be higher than this average implies, so treat it as a lower bound, not a worst case).
- RPO target: 5 minutes. Basis: 5 minutes is the maximum gap allowed between the last captured recoverable state and a failure. At the stated average order rate, a 5-minute gap risks under one order's worth of lost data on average (200 orders/day works out to about one order every 7 minutes on average, so a 5-minute window covers roughly 0.7 of that spacing), though an actual burst of orders arriving close together could lose more than the average implies, which the business judged acceptable to re-key or reconcile manually if it happens. Achieved via continuous transaction-log shipping (point-in-time recovery, PITR) capturing changes roughly every 5 minutes, layered on top of a daily full backup as the base to restore from.
- RTO target: 1 hour. Basis: 1 hour is the time from "database unreachable" to "store accepting orders again," achieved via an automated failover runbook: promote a standby replica in a separate availability zone, or restore the latest full backup and replay the shipped logs into a fresh instance, with connection-string or DNS cutover automated rather than done by hand under pressure.
Example 2: log or analytics pipeline (some data loss acceptable). Context: a pipeline ingesting application or clickstream logs into a warehouse used for internal dashboards and offline analysis, not customer-facing in real time.
- RPO target: 24 hours. Basis: 24 hours is the gap between the last completed nightly backup checkpoint and a failure. This is acceptable specifically because the upstream source (e.g. an event queue or a landing-zone object store) separately retains 7 days of raw events, so a lost day of processed warehouse data can be reprocessed from the untouched raw source rather than being permanently gone; the real cost of missing this RPO is a delay in reprocessing, not irreversible loss. Achieved via a nightly full or incremental backup of the warehouse tables; continuous log shipping isn't warranted here because the 24-hour RPO doesn't require it.
- RTO target: 8 business hours. Basis: this is measured in business hours within a single working day, not 8 calendar hours overnight, because dashboards are consulted during business hours and a pipeline down overnight causes no visible impact. Achieved via restoring the prior night's backup and re-running that day's batch ETL job once the source system is reachable again.
Why these numbers, and not others. Every value above is stated on a single, named basis: RPO is a time gap between capture events, RTO is a wall-clock duration to restored service, and the order-rate and retention figures used to justify them are explicitly labeled as averages or fixed-window retentions so they aren't mistaken for guarantees. The e-commerce example gets the tighter numbers on both axes because live revenue and payment records are on the line; the analytics example gets looser numbers on both because the underlying raw data is independently recoverable and the consumers are internal and delay-tolerant, not customer-facing.
Design a pattern for backing up and restoring petabytes of object storage data across regions, minimizing transfer costs while still meeting a 24-hour restore SLA for your most critical objects. How would you make a selective restore of just the objects you need fast, without restoring everything?
Sample Answer
Direct answer
The pattern that satisfies both constraints, transfer cost and a 24-hour restore SLA for the most critical objects, is tiering by criticality rather than replicating everything uniformly, backed by an independent, always-available metadata catalog that lets you resolve exactly which objects an incident requires without scanning the whole store. Cost scales with what you actually replicate and at what storage tier, not with the size of the total archive, which is the lever that makes petabyte-scale DR affordable at all.
Structured elaboration
Minimizing transfer cost. Most object stores at this scale have a long tail: a small fraction of objects account for most access, and a large share of the rest is genuinely cold. Replicate incrementally at the object level, only new or changed objects (detectable via version ID, ETag, a hash-based fingerprint of the object's contents that changes whenever the object does, or last-modified timestamp, avoiding re-transferring unchanged data), and place the replicated copies of cold objects in a cheaper archive storage class in the DR region rather than a uniformly warm one. That lowers ongoing storage cost even though it raises the retrieval latency for those specific objects, which is acceptable because the 24-hour SLA is explicitly scoped to the most critical objects, not the whole archive.
Worked cost example (basis: the size of the replicated critical subset, not the total store). Suppose the critical subset is 10 TB out of a 5 PB total store. Replicating just that 10 TB continuously costs egress on 10 TB, not on 5,000 TB: at an illustrative $0.02/GB egress rate, that's 10,000 GB x $0.02 = about $200 one-time (plus small ongoing costs for deltas), versus replicating the full 5 PB at the same rate, 5,000,000 GB x $0.02 = about $100,000, roughly a 500x difference. This is exactly why uniform replication doesn't scale at petabyte size and tiering by criticality does.
Meeting the 24-hour restore SLA for critical objects specifically. Keep the critical subset in a warm storage class in the DR region, immediately readable with no thaw or retrieval delay, so its restore time is bounded by network transfer and API call time, not by an archive-retrieval wait. This matters because some archive storage classes have retrieval delays ranging from minutes to tens of hours depending on the tier chosen; placing critical objects in a deep-archive tier by mistake could consume the entire 24-hour SLA before any data even starts moving, independent of network speed. The storage class chosen for the critical subset is itself an SLA-determining decision, separate from and at least as important as network throughput.
Selective fast restore without restoring everything. This requires a metadata catalog, an index of object key, version, checksum, storage tier and location, backup timestamp, and criticality classification, maintained independently as a small, always-hot database, not embedded inside the bulk archive itself (the same principle as keeping a backup catalog out of the data center it describes: if the catalog only lives inside the store that just had an incident, you can't find anything to restore). The catalog resolves "which objects does this incident actually require" to a precise list quickly, and that list drives targeted, parallelized restore requests for exactly those objects, since object stores support high per-object parallelism, rather than the much slower default of restoring a whole time-ordered prefix and scanning through it to find what's needed.
Putting it together. The pattern is: replicate incrementally and selectively rather than uniformly; place the critical subset in a warm, immediately-readable tier and everything else in cheaper archive tiers; maintain an independent, fast metadata catalog that turns "restore what we need" into a precise, parallel operation instead of a full-archive scan. Validate the design by periodically restoring a sample from the critical tier and timing it against the 24-hour SLA, and separately confirming the catalog itself stays available and accurate even during a regional incident.
Case study: A compliance workload requires 10-year retention and must be recoverable within 48 hours. Compare two approaches quantitatively and qualitatively: (A) keep replicated backup copies in two regions (higher ongoing storage/egress cost) vs (B) keep primary in lower-cost cold archive and perform on-demand restores to recover within 48 hours. What variables determine the better approach and how would you model costs and risk?
Sample Answer
Direct answer
Build a total-cost model over the same ten-year horizon for both approaches, using the same
dataset size on both sides, then find the break-even restore frequency at which the two costs are
equal. In a realistic model, keeping a cold archive copy and restoring on demand is dramatically
cheaper unless full-dataset restores happen roughly monthly or more often, which is far more often
than a genuine compliance archive is typically accessed. The variable that actually decides the
question is expected restore frequency, not raw storage price, though a hard regulatory
requirement for geographic redundancy can override the cost comparison entirely.
Quantitative model
Take an illustrative 8,000 GB (8 TB) compliance dataset, retained for 10 years, with a 48-hour
recovery requirement. All figures below are illustrative order-of-magnitude prices for
demonstrating the model, not live vendor pricing, and every step stays on the same basis: GB,
GB-month, and dollars per year, converted consistently.
Approach A: replicated copies in two regions, on a tier that supports near-immediate restore,
at an illustrative $0.01 per GB-month per region.
- Per region: 8,000 GB times $0.01 per GB-month is $80 per month.
- Two regions combined: $160 per month, or $1,920 per year, or $19,200 over 10 years.
- Plus a one-time cross-region seed transfer of roughly 8,000 GB at an illustrative $0.02 per GB
egress rate: about $160. - Total over 10 years: approximately $19,360.
Approach B: a single-region cold archive tier plus on-demand restores, at an illustrative
$0.001 per GB-month for storage and $0.02 per GB for a retrieval that still meets the 48-hour
target.
- Storage: 8,000 GB times $0.001 per GB-month is $8 per month, or $96 per year, or $960 over 10
years. - Retrieval: 8,000 GB times $0.02 per GB is $160 per full-dataset restore event.
Break-even. Setting the two ten-year totals equal: 960 plus 160 times N equals 19,360, so N
equals about 115 restore events over 10 years, roughly 11.5 per year, close to monthly. Below that
frequency, approach B is cheaper; above it, approach A is cheaper. At a more realistic frequency
for a legal-hold or audit archive, say 3 full-dataset restores across the entire 10-year hold,
approach B totals 960 plus 3 times 160, or $1,440, versus approach A's $19,360, roughly 13 times
cheaper.
Qualitative factors
- SLA margin, not just average cost. Archive tiers commonly offer a faster, pricier retrieval
option and a slower, cheaper one. For a 48-hour requirement, choose whichever tier's stated
retrieval window leaves real margin under 48 hours, not one whose window is itself close to 48
hours, since that leaves no time for locating the right data, transferring it, and validating it
before the deadline. - Regulatory mandates can override cost. Some compliance regimes require genuinely
geographically redundant, continuously available copies as a requirement in itself, independent
of how often the data is actually restored. Check whether that applies before running any cost
model; if it does, approach A may be mandated regardless of the comparison above. - Tail risk of a single archive copy. If approach B's single region is lost entirely before a
restore happens, and the archive tier does not itself provide independent geographic redundancy
beyond its own region, approach B carries more risk of total data loss than approach A's
two-region design. This risk does not show up in the average-cost model and has to be weighed
separately.
Variables that determine the better approach
Dataset size, retention duration, the price differential between the fast and cold tiers, expected
restore frequency over the retention horizon (the single largest lever, per the break-even
calculation), the archive tier's actual retrieval latency relative to the SLA's margin, and any
hard regulatory requirement for geographic redundancy that removes the choice from a pure cost
comparison.
How to model cost and risk
Compute storage cost as footprint in GB times price per GB-month times months retained, summed per
copy, and retrieval cost as expected number of restores times footprint times price per GB
retrieved, comparing both approaches over the identical retention horizon and dataset size so
nothing is compared across mismatched bases. Score the qualitative risks, SLA margin and single-copy
exposure, separately from the dollar figures, and check whether a hard compliance requirement
removes the choice before optimizing the remaining trade-off on cost alone.
Unlock Full Question Bank
Get access to all 11 Backup and Disaster Recovery interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.