Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
Databases, SQL & BIDatabase conceptLeadCommonScenario

How would you test database replication, backup restoration and failover without trusting status indicators alone?

Answer

Write identifiable records and verify their values, ordering and visibility on replicas under normal load, lag, network interruption and failover. Restore backups into an isolated environment and prove schema, constraints, row counts, critical business totals, permissions and point-in-time recovery against defined recovery objectives. Exercise client reconnection, read-after-write expectations, duplicate or lost writes, split-brain protections and failback, while measuring actual data loss and recovery time rather than only checking green dashboards.

Strong answer includes

  • verifies data rather than only infrastructure status
  • performs real isolated restore tests
  • measures recovery objectives and client behaviour

Practical example

Verify restored or replicated business data
Dialect · SQL standardRuntime · static example

The control query uses a SQL-standard DATE typed literal; real replication/recovery validation must also run against the authoritative and restored/replica databases.

SELECT
  COUNT(*) AS order_count,
  SUM(amount) AS revenue,
  MAX(updated_at) AS newest_update
FROM orders
WHERE created_at >= DATE '2026-08-01';

SELECT status, COUNT(*)
FROM orders
WHERE created_at >= DATE '2026-08-01'
GROUP BY status
ORDER BY status;

Run the same control queries against the authoritative database and the replica/restored database. Matching infrastructure status is not enough; critical row counts, totals, recent records, constraints and permissions must also be proven.

Expected result: Control totals match within the explicitly allowed replication/recovery window.

#database#replication#backup#recovery

Sources

PostgreSQL documentationPostgreSQL Global Development Group · Relational modelling, SQL, joins, constraints, transactions, concurrency, indexes, query plans and recoveryGoogle SRE booksGoogle · Reliability, SLOs, monitoring, incidents and resilience