cd /news/ai-agents/db-branch-instant-database-branches-… · home › topics › ai-agents › article
[ARTICLE · art-171375] src=byteiota.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

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.

read3 min views1 publishedNov 17, 2026
db-branch: Instant Database Branches on ZFS
Image: Byteiota (auto-discovered)

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, an Apache-2.0 tool that surfaced on Hacker News 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.

db-branch create --source prod --ttl 24h myfeature

db-branch connection-string myfeature

db-branch checkpoint myfeature pre-migration

db-branch restore myfeature pre-migration

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” — 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. 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 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.

── more in #ai-agents 4 stories · sorted by recency
── more on @db-branch 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/db-branch-instant-da…] indexed:0 read:3min 2026-11-17 · —