db-branch - Instant MySQL and PostgreSQL branches via ZFS clones
Show HN: db-branch – database branches in seconds for AI agents and CI, via ZFS

db-branch lets you spin up copy-on-write database branches in seconds, with zero data copied at creation. Built on ZFS clones, it's perfect for AI agent sandboxes, per-pull-request databases in CI, and safe migration testing. Each branch runs its own database server, and you can reset, checkpoint, or expire it with a single command. It supports MySQL and PostgreSQL across multiple versions, offers a CLI, REST API, web console, and MCP server, and can run on a single node or a Raft cluster with ProxySQL routing. Self-hosted and Apache-2.0 licensed.
db-branch creates a copy-on-write branch of a large database in seconds, with nothing copied. Break it, reset it, throw it away.
- pjm331
So nice to have a way to get cheap db clones, I just set up this at work recently to do the same thing https://postgres.ai/docs/database-lab
- rzzzt
Is it possible to merge changes from a clone/branch back to the "official copy"?
- t0mas88
Postgres 18 has file_copy_method = clone for this, is that used underneath or did you implement your own own?