Aller au contenu
#0083
Sqlite

Point-in-time recovery on a per-key basis

A customer reports their settings were "wrong this morning, then fixed themselves, now wrong again." Three hours of mystery in a row. You'd normally scrape an audit table and pray.

Instead you GET kv/user:4711:settings/snapshot?db=app.db&timestamp=1741017420. You get the value as it was at 2:47pm. You GET it again with a different timestamp at 3:15pm. And again at 3:42. Three snapshots, three values, the timeline writes itself.

You see the change at 3:01: the mobile app overwrote a field it shouldn't have. You restore the right value with one PUT and you tell the customer when, what, and why. Then you fix the mobile bug.

Backups are coarse: they restore the whole database to one moment. Time-travel is fine-grained: it restores one key to any moment.

You don't restore a database. You ask for a key as it was at 2:47pm.