What is db-branch?
DB Branch creates disposable, self-hosted branches of MySQL and PostgreSQL databases using ZFS copy-on-write snapshots. It is for developers and operations teams who need isolated databases for pull requests, migration checks, or agent experiments without changing the original data. Each branch runs as its own database server, and the product can be managed through a web console, CLI, REST API, or MCP server. It runs on Ubuntu with ZFS; there is no hosted cloud version.
db-branch Features:
Copy On Write: Branches clone a base snapshot without copying its data, and use additional storage only for blocks they change.
MySQL and PostgreSQL: Create bases and branches for either database engine, with branches using the same runtime version as their base.
Scheduled Refresh: Configure DB Branch to pull from production or a replica, load the data, and take snapshots at an interval.
Branch Checkpoints: Save a branch state, restore a checkpoint, or reset the branch to its starting snapshot.
Multiple Interfaces: Manage bases and branches through the web console, CLI, REST API, or built-in MCP server.
Cluster Routing: Run nodes in a Raft cluster with replicated snapshots, and use ProxySQL to route connections to branches.
db-branch Benefits:
Fast Setup: Teams can get a working copy of a large database without waiting for a full data copy to finish.
Less Duplicate Storage: Branches share unchanged data with their base, so multiple copies need space mainly for their separate writes.
Safer Experiments: Changes stay within a branch, giving developers room to test queries or migrations without altering the original.
Quick Recovery: A reset returns a branch to its initial state without reloading a dump or rerunning setup SQL.
Data Control: Self-hosting keeps database data on the team's own network rather than sending it to a hosted service.
Use Cases:
Pull Request Testing: Create a separate database for each pull request, then remove it when the request closes or its expiry is reached.
Migration Checks: Try a schema or data migration on a branch before applying it to a base or production database.
Version Upgrades: Upgrade one branch to a newer MySQL or PostgreSQL runtime while leaving the base and other branches unchanged.
Agent Sandboxes: Give an MCP-connected AI agent a branch to run queries or migrations without writing to production.
Production Data Copies: Refresh a base from production or a replica on a schedule, then branch from its current or older snapshots.

