Git gave code cheap branching, rollback and merge. Data never got the same deal — because data is huge; one copy is a terabyte.
But a trend is changing that: the people editing data are turning into AI clusters. When the scale and frequency of writes go up an order of magnitude, branch / merge / rollback move from “nice feature” to “the only way this can be safe”.
1. What data versioning needs
Strip the product narrative and a data version system needs at least three things:
| Component | Role |
|---|---|
| Retention | Keep old versions alive — the real gate isn’t “can read old versions” but “do old versions still exist” |
| Registry | Remember which commit a snapshot is pinned to, durably across processes and crashes |
| Read at pin | A path that reads at a given version instead of always reading latest |
2. Implementing it on DuckDB
This series records implementing these primitives on DuckDB — from feasibility analysis, through snapshots, retention watermarks, branches, diff and merge, to moving the registry into internal tables for transactions and crash consistency.
Four posts:
- Feasibility: why an analytical database can grow version control
- Pinning history: snapshots, retention watermarks and AT SNAPSHOT
- Branches, diff, pick, merge
- Moving metadata into tables
3. One key realization
Before doing this I thought the hard part was “reading history”. After doing it, the hard parts turned out to be three lower-level things:
- Retention: checkpoint reclaims old versions; pins must block it;
- Transactions: metadata must go through the WAL too, or a crash loses it;
- Identity: after a table is renamed, recreated or migrated, you still must tell whether it is the same table.
4. Three real scenarios
Scenario 1: bulk writes by agents An agent rewrites 400K rows every night. When it goes wrong you don’t need “restore a backup”; you need “go back to 2:17 last night” — that’s PITR, not backup.
Scenario 2: reproducible experiments Run three feature-engineering variants on the same data; results must map to which version was used. Branches are cheaper than copying files.
Scenario 3: undo a mistaken delete
After a DELETE, the snapshot and clone still exist; recovery is just switching a reference — provided retention hasn’t dropped the old versions.
5. How it differs from Git
| Dimension | Git | Data versioning |
|---|---|---|
| Data size | MBs | GB–TB; can’t copy wholesale |
| Writes | whole-file replacement | row/column-level deltas |
| Concurrency | mostly single writer | multiple writers, long transactions |
| Retention | manual gc | retention watermark and quotas are mandatory |
| Merge | line-level diff | needs schema and semantics |
So it isn’t “Git on a database” — it’s a different set of primitives designed for data scale.
4. An honest expectation
This is a research prototype, not a production system: it covers the core primitives (snapshots, branches, diff, merge, clone, PITR) but has no performance work and does not cover every edge case. The series marks what is measured and what is inferred.
Get the next essay
New essays on products, business and tech — plus what the experiment's numbers actually say.