# db-branch

> db-branch is an open-source AI tool for databases. Copy-on-write MySQL and PostgreSQL branches for tests, CI and AI agents, self-hosted. It is available on Linux, API, CLI, Web and self-hosted.

- **Kind:** Tool
- **Pricing:** Open source
- **Platforms:** Linux, API, CLI, Web, self-hosted
- **Repository:** https://github.com/db-branch/db-branch
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The README says db-branch gives each database branch its own running server, created as a ZFS clone of a base snapshot, so a branch of a large database appears in seconds without copying data. Branches can be reset, checkpointed and restored, or expire automatically with a time-to-live setting.

It is managed through a CLI, a REST API, a web console and a built-in MCP server, so the same operations are available to scripts, CI jobs and LLM agents. Optional ProxySQL routing sends client connections to the right branch by user name or query comment, and several nodes can form a Raft cluster.

The project is in Beta and targets teams that run Ubuntu servers with ZFS and want disposable database copies on their own hardware. The README notes it needs Linux and ZFS, so Mac and Windows users are pointed to a Multipass virtual machine for trials.

## Features

- **Copy-on-write branches:** Creates a database branch from a base snapshot as a ZFS clone, so no data is copied at creation.
- **Checkpoints and restore:** Saves a branch's state instantly and restores it later, keeping existing checkpoints available.
- **Per-branch version upgrades:** Upgrades one branch to a newer MySQL or PostgreSQL version and rolls back automatically if it fails.
- **Automatic expiry:** Deletes branches after a set time-to-live, useful for per-pull-request databases.
- **MCP server for agents:** Lets LLM agents create, query and delete their own branches through the built-in MCP server.
- **Optional ProxySQL routing:** Routes client connections to the correct branch by user name or a query comment.

## Good for

- Run risky queries or migrations on a throwaway copy instead of production
- Give each CI run or pull request its own copy of a large database
- Sandbox AI agent database access so production data is not touched
- Test a major MySQL or PostgreSQL version upgrade on one branch before changing the base

## FAQ

### What does db-branch need to run?

The README says it requires Ubuntu 24.04 LTS or 26.04 LTS and a ZFS pool, with zfsutils-linux installed as a dependency.

### Is there a hosted version?

No. The README states there is no hosted or cloud version of db-branch.

### Which databases are supported?

MySQL and PostgreSQL, with several engine versions able to run side by side.

### What license is the core under?

The core repository is licensed under Apache-2.0. Some paid modules such as auth/SSO and audit are separate closed-source packages.

### Is db-branch free?

Yes. db-branch is open source, so you can use and self-host it for free.

### What are the best alternatives to db-branch?

The closest alternatives to db-branch are Powabase and cc-switch.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [Powabase](https://ai-powered.com/tools/powabase): Powabase is a freemium AI tool for developer tools.
- [cc-switch](https://ai-powered.com/tools/cc-switch): cc-switch is an open-source AI tool for developer tools.

---
Source: https://ai-powered.com/tools/db-branch
