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.
Propose a backup and recovery strategy for a high-throughput OLTP database that needs to minimize both RPO and RTO while staying cost-effective. How would your approach need to adapt while a major schema migration is in flight?
Sample Answer
Direct answer
For a high-throughput OLTP (Online Transaction Processing) database, the baseline design is continuous log shipping to a warm standby for RTO (Recovery Time Objective, the downtime target), plus periodic base backups sized so worst-case log replay stays bounded, for cost-effective RPO (Recovery Point Objective, the data-loss-window target). The part that's specific to this question is what changes during a schema migration: the migration itself temporarily changes both the write volume feeding your logs and the risk profile of what a restore actually recovers you into, and the strategy has to adapt on both counts, not just keep running unchanged.
Structured elaboration
Baseline strategy. Continuous transaction-log shipping (e.g. WAL, the write-ahead log) to a standby, asynchronous by default since it avoids the write-latency tax of synchronous replication and is cost-effective unless RPO needs to be near-zero, plus periodic base backups (e.g. daily) that bound how much log has to be replayed in a cold-restore fallback, using the same worst-case-replay reasoning. For a high-throughput system specifically, the WAL volume itself is large, so keep the cost-effective posture by compressing archived logs, tiering older log segments (past the near-term point-in-time recovery window but still inside the compliance retention period) to cheaper storage, and setting the fine-grained recovery window deliberately short (e.g. 7 days) rather than keeping every log segment at full fidelity indefinitely.
How the approach adapts during a schema migration.
- Backups taken mid-migration can capture the database in a transitional state, for example a new column half-populated by a backfill job, or dual-write logic active between an old and new schema. A point-in-time restore to a moment inside that window can put the database into a state the currently deployed application code doesn't actually handle correctly, if the app has already moved past assuming the migration finished. So: take an explicit, clearly labeled backup immediately before starting the migration as a clean rollback point, and treat any restore target that falls inside the migration window with extra caution, verifying which application version was actually live at that data version before trusting the restore.
- A long-running online migration (e.g. backfilling a large table without locking it) generates a large, temporary burst of extra log volume, since the backfill is itself a heavy write workload. That has two effects: it temporarily raises log storage cost for the duration of the window, and it can push replication lag up, since the standby has to apply the same burst. Either throttle the backfill's write rate to stay within the standby's apply capacity, or explicitly accept and communicate a temporarily wider RPO during the migration window rather than being surprised by it later.
- Test the restore and rollback path for the migration specifically, as part of migration planning, not as generic backup hygiene run separately: rehearse restoring to the pre-migration snapshot and confirm the pre-migration application version actually runs correctly against it, as a required step in the migration's own runbook, not an afterthought.
The general principle: a schema migration is a temporary, known-risk event that the ongoing backup and DR posture should explicitly account for, with a deliberate pre-migration checkpoint and a tested rollback path, rather than assuming the steady-state backup design covers it automatically.
Design a highly available PostgreSQL-based OLTP architecture on AWS with a 99.99% availability target. Would you reach for RDS Multi-AZ or Aurora, and why? Walk through the rest of your design and how each choice trades off against RTO/RPO and cost.
Sample Answer
Direct answer
Both RDS Multi-AZ and Aurora give synchronous, multi-AZ data durability with an RPO (Recovery Point Objective, maximum acceptable data loss) effectively at zero for infrastructure failures within a region, so the 99.99% availability target is achievable with either. The differentiator is failover speed and cross-region disaster recovery: Aurora's storage layer is already replicated across AZs independently of how many compute replicas you run, which typically makes its failover faster than RDS Multi-AZ's, and Aurora Global Database gives materially tighter cross-region RPO than a standard RDS cross-region read replica, at a real added cost. Neither option, on its own, protects against a bad write or a human error like an unqualified DELETE, since synchronous replication faithfully replicates mistakes just as reliably as it replicates good writes; that's what point-in-time recovery (PITR) is separately for.
Structured elaboration
RDS Multi-AZ. A standard managed Postgres instance with a synchronous physical standby in a second AZ (Availability Zone: an independent data center within the same region) in the same region. Failover is automatic on primary failure, typically completing in roughly one to two minutes per AWS's own documentation (a vendor-reported figure, not independently measured here, and worth treating as approximate), via a DNS endpoint flip to the new primary. RPO is effectively zero for AZ-level or instance-level failures, since the standby only acknowledges synchronously. This covers AZ and instance failure within one region; it does not cover a full regional outage or a logical error, both of which need a separate mechanism: automated backups plus continuous WAL (write-ahead log) archiving to object storage for PITR, and optionally an asynchronous cross-region read replica that can be promoted for regional DR, with RPO in that case bounded by replica lag rather than zero.
Aurora. A Postgres-compatible managed service where the underlying storage layer is itself distributed and replicated across multiple AZs (commonly reported as 6 copies across 3 AZs) independent of how many compute instances are provisioned, so a single Aurora instance already has multi-AZ storage durability built in. Failover to an Aurora Replica, where one exists, is typically faster than RDS Multi-AZ's, often reported in the tens of seconds, because the new primary doesn't need to redo as much work on promotion, the storage layer is already shared and current (again a vendor-reported figure, flagged as such rather than personally benchmarked). RPO for AZ-level failure is effectively zero for the same reason. Aurora Global Database extends this with asynchronous cross-region replication, commonly reported at sub-second to low-single-digit-second lag, materially tighter than a standard RDS cross-region replica's typical lag (also vendor-reported, not independently verified here).
Recommendation and the RTO/RPO/cost trade-off. If the 99.99% target is purely about tolerating an AZ-level failure within one region, plain RDS Multi-AZ is the more cost-effective choice: it clears that bar with a simpler pricing model (roughly instance-plus-storage cost doubled for the standby) and doesn't require paying for Aurora's more sophisticated storage layer or a Global Database second region you may not need. If regional disaster recovery is also a genuine requirement, worth calling out as a distinct requirement from the AZ-level 99.99% figure, not something automatically implied by it, Aurora Global Database earns its added cost through a materially tighter cross-region RPO than a standard RDS cross-region replica provides.
The rest of the design. Layer PITR on top of whichever option is chosen: both support continuous backup to object storage with restore to any specific second within the retention window (commonly up to 35 days), which is the actual safety net for logical or human error, something no amount of synchronous replication provides. Run periodic DR drills that promote a cross-region replica into an isolated network and validate the real, measured regional RTO and RPO against target, the same rehearsal discipline any DR design needs, rather than trusting the vendor-documented failover numbers without ever having exercised them for real.
Your primary cloud region experiences a catastrophic outage that corrupts the primary metadata store for the data lake. Walk through a detailed recovery plan to restore data availability and integrity across analytics clusters, including verification steps, timelines, coordination with stakeholders, and how you'd prevent reoccurrence.
Sample Answer
Direct answer
The first thing to establish, before any restore action, is whether the raw data itself was actually lost or just the metadata catalog that points to it, because in most data lake architectures the two live in genuinely separate systems with different durability properties: raw data typically sits in durable, often multi-region object storage, while the metadata store (a Hive Metastore, a service that maps table and partition names to their physical file locations in storage, a table-format transaction log, or similar) is frequently a separate, sometimes less-replicated service. If the raw files survived, this is a metadata-restore-and-reconciliation problem, materially faster and lower-risk than actually reconstructing lost data, and the recovery plan should confirm that distinction first rather than assuming the worse case.
Structured elaboration
Recovery plan.
- Verify raw data integrity independently of the metadata layer: spot-check object storage for the underlying data files and partitions against checksums or a manifest, confirming what actually exists before touching the catalog at all.
- Restore the metadata store from its own backup into a new, isolated instance in a healthy region, rather than attempting an in-place repair on infrastructure that may itself be compromised.
- Reconcile the restored catalog against the actual state of object storage: the catalog's backup is likely slightly stale relative to what was truly written before the outage, so run a reconciliation or repair scan (most lake table formats support a metadata-refresh operation that re-scans partitions in storage and re-registers them) to close any gap, rather than assuming the restored catalog and the real storage state already agree.
- Repoint analytics clusters at the restored metadata endpoint, refresh or restart their cached catalog connections, and run smoke queries against known tables before declaring the service restored.
Verification steps. Row-count and partition-count checks on a sample of critical tables against pre-incident baselines, if monitoring captured any. Confirm the reconciliation scan found no orphaned partitions (data present in storage but missing from the catalog) or dangling entries (registered in the catalog but missing from storage). Run the existing scheduled analytics jobs and dashboards end to end as a real-world validation, checking output shape and volume against expectations, not just that the jobs completed without error.
Timelines (illustrative, to be re-measured against the real lake's scale, not asserted as fixed). Raw-data integrity check: roughly 30 minutes. Metadata restore: roughly 30 to 60 minutes, depending on catalog size. Reconciliation scan: roughly 1 to 3 hours, the phase most sensitive to lake size, since a lake with millions of partitions takes meaningfully longer to reconcile than a small one, so this is the phase to size against actual partition count rather than assume constant, and the first place to invest in parallelizing if the recovery doesn't meet the business's RTO. Cluster repoint and smoke validation: roughly 30 minutes. Total order of magnitude: a few hours for a moderately sized lake, dominated by the reconciliation scan at larger scale.
Coordination with stakeholders. Data platform and on-call engineering drive the recovery itself. Downstream analytics and BI consumers need early notice that outputs may be delayed or stale, and should be told explicitly to hold off trusting dashboards until the recovery is formally declared verified, not just "clusters back online." Leadership or an incident commander should be looped in for an incident of this severity, and if any customer-facing derived data was affected, whoever owns customer communication needs to be brought in as well.
Preventing reoccurrence. Replicate the metadata store itself cross-region, so it isn't a single-region point of failure sitting underneath data that's already durable and multi-region; if the metastore technology doesn't support replication, increase its own backup frequency instead. Add automated, scheduled reconciliation scans that run continuously, not only during an incident, so catalog-to-storage drift is caught and fixed before it can compound into a catastrophic surprise. Document this exact runbook, including the timeline breakdown above, so the next occurrence is executed from a tested procedure rather than improvised from scratch under pressure again.
You discover the company runs all data in a single cloud region and their public docs don't mention DR. Propose a disaster recovery (DR) plan for data pipelines and analytics warehouses that specifies RTO and RPO targets for critical datasets, cross-region replication strategies (synchronous vs asynchronous), and a test plan to validate failover without data loss.
Sample Answer
Direct answer
For data pipelines and analytics warehouses specifically, asynchronous replication is almost always the right default, unlike a transactional OLTP (Online Transaction Processing) system where a tight RPO can justify synchronous replication's write-latency cost, batch and analytical workloads aren't latency-sensitive on the write path the way a user-facing transaction is, so synchronous replication buys little here and costs real throughput. The design splits into three different assets with different DR treatments: the raw data lake (the true source of truth, worth continuous replication), pipeline code and orchestration definitions (which are code, not data, and are protected by version control and redeploy, not by a data-replication mechanism), and the warehouse itself (which is often cheaper to rebuild from the replicated raw data than to keep continuously synced).
Structured elaboration
Proposed RTO/RPO targets (RTO, downtime allowed; RPO, data loss allowed; illustrative, since none were given). Ingestion pipelines: RTO of roughly 4 hours, RPO of roughly 1 hour, since a paused pipeline for a few hours is usually tolerable and later batches catch up once it resumes. The warehouse, for critical and executive-facing datasets: RTO of roughly 8 hours, RPO of roughly 24 hours, since a warehouse's DR posture is often "can we replay pipeline history and raw data into a fresh regional warehouse" rather than requiring continuous replication of its derived tables.
Cross-region replication: sync vs async. Replicate the raw data lake (object storage, the true source of truth) cross-region asynchronously via the object store's native replication feature, typically propagating newly written objects within minutes per most cloud object stores' documented behavior. Replicate pipeline orchestration definitions (DAGs, job configs) via ordinary version control and redeploy, not via a data-replication mechanism at all, since they're code: using the data-DR toolchain for what's really an infrastructure-as-code artifact would be the wrong tool, slower and more complex than a redeploy. For the warehouse itself, choose between (a) maintaining a continuously-synced warehouse instance in the DR region if the platform supports asynchronous replication of it, or (b) relying on rebuild-from-raw-data (rerunning pipelines against the already-replicated raw data lake in the DR region) if the warehouse's own looser RTO tolerance can afford a rebuild instead of paying for a second continuously-synced warehouse. This is a direct cost-versus-RTO trade-off worth naming explicitly to stakeholders rather than defaulting silently to the more expensive option.
Test plan to validate failover without data loss. 1. Establish a baseline before any drill: capture row counts, checksums, and watermarks (e.g. the maximum ingested timestamp per critical table) in the primary region. 2. Execute the failover drill in an isolated DR environment, promoting the DR region's replicated raw data lake and pointing pipelines at it, never rehearsing by touching the live primary. 3. Compare the post-failover state against the baseline: row counts and watermarks in the DR environment should match up to the last successfully replicated point, verifying that observed data loss, if any, is actually within the proposed RPO budget rather than just confirming that some data arrived. 4. Time the full drill against the proposed RTO targets and identify which phase, replication catch-up, pipeline rerun time, or warehouse rebuild time, consumed the most time, so investment goes where it's actually needed. 5. Repeat on a regular cadence, e.g. quarterly, since pipeline and warehouse volume grows over time and a passing drill today doesn't guarantee tomorrow's numbers hold as data scales up.
You inherit a data engineering team with no documented backup or retention policies for critical datasets. Describe the first five actions you'd take in the first week to assess risk and improve backup coverage, including stakeholders you would engage and immediate mitigation steps.
Sample Answer
Direct answer
With zero documented backup or retention policy, the first week isn't about designing the final policy, it's about finding out what's actually at risk right now and stopping the worst of the bleeding cheaply while the real design gets built with stakeholder input. Five concrete actions: inventory what exists, risk-rank the gaps, apply cheap immediate mitigation to the worst gaps, engage the right stakeholders to learn real tolerance, and draft (not finalize) a policy proposal by end of week.
Structured elaboration
- Inventory everything. Enumerate every dataset and system in scope, not just the ones assumed to be important, and for each record: owner, storage location, current backup state (none, partial, or full, including any accidental backup like storage versioning that happens to be enabled by default), rough size, and an initial, still-rough criticality guess. This produces a single source of truth to work from instead of relying on institutional memory about "what's probably backed up."
- Risk-rank the gaps. Cross the inventory against "what would hurt most if lost right now, with zero warning." Flag anything that is both business-critical and has zero backup as a Day-1 emergency, distinct from lower-priority gaps that can wait for the full policy design.
- Apply immediate, cheap mitigation to the worst gaps. For each Day-1 emergency dataset, put an imperfect stopgap in place fast rather than waiting for a proper strategy: enable native storage versioning or snapshotting if the platform offers it at no meaningful cost, or run a manual one-off export to a separate location. The goal is only to stop the bleeding while the real design is built, not to be the final answer.
- Engage stakeholders. Talk to the actual owners of each critical dataset (they usually already know their real pain tolerance, even if it was never written down), for example finance for billing data or the ML team for training data, to learn real RTO/RPO tolerance (RTO: how long that data's owner can accept being without it; RPO: how much recent data they can accept losing) rather than guessing it. Engage whoever controls infrastructure budget, since real backup infrastructure costs money and needs sign-off. Engage compliance or legal if any datasets carry mandated retention requirements (e.g. financial or personal data with a legal retention period), since regulatory obligation is often a more urgent forcing function for the policy than general best practice.
- Draft a policy proposal, explicitly framed as a draft. By end of week one, propose target tiers (e.g. critical, standard, low), draft RPO/RTO ranges per tier grounded in what stakeholders actually said in step 4, and a rough implementation timeline, presented for review and sign-off, not dictated unilaterally, since a real policy needs buy-in from the people whose data and budget it affects.
The common thread across all five: cheap, reversible action now for the worst-exposed data, paired with real information-gathering, rather than either doing nothing while a perfect policy gets designed, or over-engineering a stopgap that should really be temporary.
Unlock Full Question Bank
Get access to all 6 Backup and Disaster Recovery interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.