db-branch: Instant Database Branches on ZFS An Apache-2.0 tool called db-branch, posted to Hacker News, branches terabyte-scale MySQL and PostgreSQL databases in under two seconds at zero disk cost by mounting data directories on ZFS datasets and cloning copy-on-write snapshots. db-branch starts a separate database process on each clone on a new port routed through ProxySQL, returns a standard JDBC or DSN connection string, and adds TTL-based auto-destroy plus checkpoint/restore commands; it ships as a single Go binary with an embedded React console and Raft consensus plus ZFS send/recv replication for clustering. The project targets self-hosted teams with data residency or air-gapped requirements and pitches per-run throwaway databases for AI coding agents that execute SQL migrations autonomously, a category Databricks calls the "agentic SDLC. Branching a terabyte-scale database in under two seconds, at zero disk cost, with no cloud vendor in the loop — that’s the pitch from db-branch https://github.com/db-branch/db-branch , an Apache-2.0 tool that surfaced on Hacker News https://news.ycombinator.com/item?id=50506940 today. It applies ZFS copy-on-write clones to MySQL and PostgreSQL to give every developer, CI pipeline, and AI coding agent an isolated, full-data database environment that spins up in seconds and disappears when done. The Problem With Shared Staging If you’ve worked on a team with ten engineers and ten simultaneous feature branches, you know the pain. Everyone fights over one staging database. Schema migrations get tested against stale dumps. The devs doing destructive data work slow everyone else down. And if you’re running AI coding agents that mutate data autonomously, a shared database is a liability waiting to happen — one DROP TABLE away from a bad afternoon. The current workarounds — manual pg dump pipelines, spinning up separate provisioned RDS instances per branch, or just yolo-ing it on shared staging — are all either slow, expensive, or unreliable. Database branching has been a cloud-first story until now. Tools like Neon Postgres, cloud-only , PlanetScale MySQL, schema changes only , and Databricks Lakebase enterprise analytics all require you to live in their ecosystem. db-branch doesn’t. How It Works db-branch mounts your MySQL or PostgreSQL data directory on a ZFS dataset. When you create a branch, it takes a ZFS snapshot of a cleanly shut-down instance and clones it — a copy-on-write operation that takes the same time regardless of whether the dataset is 1GB or 1TB. A separate database process starts on the clone on a new port, routed through ProxySQL. The connection string you get back is standard JDBC or DSN — nothing about your application code changes. Create a branch from production, auto-destroy in 24h db-branch create --source prod --ttl 24h myfeature Get connection string — works with any MySQL/PostgreSQL client db-branch connection-string myfeature Save state before a risky migration db-branch checkpoint myfeature pre-migration Oops. Roll back. db-branch restore myfeature pre-migration Done. Clean up. db-branch destroy myfeature The checkpoint and restore commands are what elevate this beyond a simple clone script. You can run a migration, verify it, roll back if something looks wrong, and iterate — all without reprovisioning the branch from scratch. The AI Agent Use Case The killer use case in 2026 isn’t developer sandboxes — it’s AI agents. When a coding agent has permission to run SQL migrations autonomously, you need every agent run isolated at the database layer, not just the filesystem. db-branch’s TTL-based branches give each agent its own throwaway database environment: when the run completes or the agent goes rogue, you destroy the ZFS clone. Nothing touches production. Nothing touches sibling branches. Databricks calls this the “agentic SDLC” https://www.databricks.com/blog/lakebase-and-agentic-sdlc-branching-databases-coding-agents — it’s becoming a recognized category, and db-branch is the first self-hosted tool to target it seriously. Self-Hosted Is the Point The conventional advice is to reach for Neon or PlanetScale for database branching. That advice assumes you can. For teams with data residency requirements, air-gapped infrastructure, high-volume branch churn that would rack up cloud costs, or a preference for owning their stack — the cloud options don’t apply. db-branch ships production-grade clustering Raft consensus + ZFS send/recv replication as a single Go binary with an embedded React web console. The HN community response was telling: several commenters mentioned they’d already built bash scripts to do roughly the same thing with ZFS snapshots and called db-branch what those scripts always wanted to evolve into https://deepwiki.com/db-branch/db-branch . The ZFS approach works — DBLab validated it years ago. db-branch just packages it properly, adding Raft clustering and a real CLI on top. Getting Started Prerequisites: a ZFS pool, MySQL 8.x or PostgreSQL 15+, and ProxySQL. Install the binary, point it at your ZFS pool, run db-branch init , and your first branch is two commands away. The README https://github.com/db-branch/db-branch covers single-node setup in about ten minutes; Raft clustering for multi-VM teams is documented in the same repo. If your team is still doing pg dump | pg restore pipelines for feature branch databases, this is worth half an hour of your time.