← All projects
Project record1 mention
Originally shared on Hacker News

db-branch

Self-hosted tool that uses ZFS copy-on-write snapshots to create, destroy, and reset disposable MySQL and PostgreSQL database branches in seconds, even for terabyte-scale databases. Each branch runs as its own database process, with ProxySQL routing clients by connecting user or a query comment; clusters are built with Raft and ZFS send/recv. Aimed at per-PR preview environments, CI, and as a disposable SQL sandbox for AI agents. The core branching engine and clustering are open source and free; a commercial plan offers a History Module (query recording and restore to any point) with planned enterprise features such as user management, SSO, and auditing.

Last shared For Developers using CI pipelines and per-PR preview environments, and teams wanting a self-hosted, disposable SQL sandbox for AI coding agents.
01 / The problem

What it addresses

Per-PR preview environments usually rely on one shared database, and managed branching services like PlanetScale, Neon, and Aurora are tied to specific cloud vendors, which can be costly or impractical for air-gapped/on-prem or laptop use; pointing AI coding agents directly at production or staging is dangerous.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. db-branch

    Self-hosted tool that uses ZFS copy-on-write snapshots to create, destroy, and reset disposable MySQL and PostgreSQL database branches in seconds, even for terabyte-scale databases. Each branch runs as its own database process, with ProxySQL routing clients by connecting user or a query comment; clusters are built with Raft and ZFS send/recv. Aimed at per-PR preview environments, CI, and as a disposable SQL sandbox for AI agents. The core branching engine and clustering are open source and free; a commercial plan offers a History Module (query recording and restore to any point) with planned enterprise features such as user management, SSO, and auditing.

    Problem: Per-PR preview environments usually rely on one shared database, and managed branching services like PlanetScale, Neon, and Aurora are tied to specific cloud vendors, which can be costly or impractical for air-gapped/on-prem or laptop use; pointing AI coding agents directly at production or staging is dangerous.

    Audience: Developers using CI pipelines and per-PR preview environments, and teams wanting a self-hosted, disposable SQL sandbox for AI coding agents.

    Posted by @nu_nu11 · Original source ↗

    Story title · @nu_nu11 · · Source ↗

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

    Submitted URL · @nu_nu11 · · Source ↗

    https://github.com/db-branch/db-branch

    Source text · @nu_nu11 · · Source ↗

    db-branch uses ZFS copy-on-write to create, destroy, and reset MySQL and PostgreSQL clones in seconds, even for terabyte-scale databases. It's self-hosted and doesn't depend on any cloud vendor.

    Source text · @nu_nu11 · · Source ↗

    Per-PR preview environments are common now, but the database is usually still a shared one. PlanetScale, Neon, and Aurora's fast clone solved this with Git-like branching, even for huge datasets: cut a branch in an instant, throw it away when you're done.

    Source text · @nu_nu11 · · Source ↗

    The catch is that these are managed services tied to specific cloud vendors. Cost can be a barrier, fully air-gapped (on-prem) environments have constraints, and sometimes you just want the same workflow on your laptop. db-branch is meant for those cases.

    Source text · @nu_nu11 · · Source ↗

    Pointing an agent at production or staging directly is dangerous. With a branch, even if the agent runs something destructive (a DROP, a massive UPDATE), you just throw the branch away or roll back to a snapshot. Being a disposable DB sandbox for AI agents is one of the goals of this project.

    Source text · @nu_nu11 · · Source ↗

    To keep the project sustainable, the core branching engine and the clustering feature are released as fully open source, free of charge.