Recovery drill
Overview
A recovery drill proves whether a backup can be restored and whether business invariants still hold. Make a backup before a controlled mutation, restore into a different disposable database, compare rows and run integrity checks. Never test destructive recovery against an existing application database.
First example
PRAGMA integrity_check;Observed SQLite result (rows in JSON):
[ [ "ok" ]]How it works
The SQL checks return ok for structural integrity and no rows for foreign-key violations. The Python backup lab copies the baseline, changes source stock, restores to another database and compares the full logical dump and business totals. The backup API demonstrates snapshot recovery, not PostgreSQL WAL point-in-time recovery. Record RPO/RTO targets separately from actual measured drill time; this lab does not certify either objective.
Practical example
PRAGMA foreign_key_check;Observed SQLite result (rows in JSON):
[]Practice and mistakes
Practice: record a backup manifest and restore checklist, then verify both stock and paid totals. Hint 1: use an isolated destination. Hint 2: compare the baseline rows, not just file existence. Mistake: marking a backup successful without attempting a restore.
PostgreSQL 17 example — NOT RUN
SELECT pg_is_in_recovery();Expected result, not executed: "Depends on server state; not a restore drill."