Point-in-Time Recovery
ELI5 — The Vibe Check
Point-in-time recovery (PITR) is the database equivalent of a time machine. Accidentally deleted all your users at 3:47 PM? No problem, rewind the database to 3:46 PM. It works by replaying the write-ahead log up to the exact moment you specify. It's the ultimate 'undo' button.
Real Talk
Point-in-Time Recovery (PITR) allows restoring a database to any specific moment by combining a base backup with WAL (Write-Ahead Log) replay up to a target timestamp or transaction ID. It protects against human error, corruption, and data loss beyond what regular backups provide. Most managed databases offer PITR with configurable retention windows.
When You'll Hear This
"PITR saved us when someone ran DELETE without a WHERE clause." / "Our managed Postgres offers 7-day point-in-time recovery."
Related Terms
Flyway
Flyway is a migration tool that keeps track of every change you've ever made to your database schema, in order, like a meticulous diary.
Liquibase
Liquibase is like Flyway's more enterprise cousin who wears a suit. It tracks database changes but uses XML, YAML, or JSON changelogs instead of raw SQL.
Snapshot Isolation
Snapshot isolation gives each transaction a frozen-in-time photo of the database.
Write-Ahead Log
The Write-Ahead Log (WAL) is the database's diary. Before changing any actual data, the database first writes what it's about to do in this log.