Skip to content

Branch any database. Not just Postgres.

Neon made Postgres branching famous. Layerbase does the same trick for 9 engines, because the branch happens at the filesystem, not inside the database. Fork a running database into a full, isolated copy in seconds. Point a preview at it, rehearse a migration against it, then throw it away.

mainpreview-pr-142Vercel preview points heremigration-test

One database, three timelines. The branches share the parent history until the moment they diverge.

Three steps, then get on with your day

The workflow is the same whether you branch from the cloud dashboard or from SpinDB on your laptop.

Fork it

Hit Branch on a running database, or run spindb branch app app-test locally. Copy-on-write means the clone is ready in seconds, with its own name and credentials, no dump and restore.

Connect to it

The branch hands you its own connection string. Point a preview deploy, a migration script, or psql at it. It is a full, writable database that has no idea it was cloned.

Reset or drop it

Re-fork from the parent to start clean, or delete the branch when the PR merges. Unchanged blocks were never copied, so teardown is as cheap as the fork was.

A branch copies pointers, not bytes

Branchable databases run on ZFS. When you branch, the clone starts as a set of references to the parent blocks. Nothing is duplicated up front. The engine writes a block only when you change that data, and only those changed blocks land on disk.

That is why a branch is near-instant and nearly free. You are billed for what diverges, bounded by your plan storage quota, not for a second full copy of the database.

main

preview-pr-142

Shared block, no new storageWritten on the branch, the only bytes you pay for
Traditional copyduplicates every byte
Layerbase branchonly the blocks you change

What branches are actually for

A throwaway copy of real data solves a handful of jobs that seed scripts and shared staging never quite did.

Preview environments

Give every pull request a branch that carries production-shaped data instead of a bare seed file. Wire it to a Vercel preview and the deploy talks to its own database.

Vercel integration

Migration rehearsal

Fork prod, run the migration against the branch, and watch it pass or blow up before it ever touches the real thing. Reset and try the fixed version. Repeat until it is boring.

Debug on real data

Reproduce a data-shaped bug against a branch of production without risking production. Poke at it, run the destructive query you were scared to run, then throw the branch away.

9 engines branch today

MongoDB is not branchable yet, but FerretDB is, and it speaks the MongoDB wire protocol. Point your Mongo driver at a FerretDB branch and nothing in your code changes.

Branchable now

PostgreSQL

MySQL

MariaDB

Redis

Valkey

Redis-compatible

FerretDB

MongoDB-compatible

LibSQL

SQLite-compatible

SQLite

DuckDB

On the way

  • MongoDBWrites its config after the container starts; the branch copy runs before that step. On the roadmap.
  • CockroachDBNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • ClickHouseNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • QdrantNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • MeilisearchNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • CouchDBNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • SurrealDBWrites its config after the container starts; the branch copy runs before that step. On the roadmap.
  • QuestDBWrites its config after the container starts; the branch copy runs before that step. On the roadmap.
  • TypeDBNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.
  • InfluxDBWrites its config after the container starts; the branch copy runs before that step. On the roadmap.
  • WeaviateWrites its config after the container starts; the branch copy runs before that step. On the roadmap.
  • TigerBeetleNot yet on the branching storage class. The method is engine-agnostic, so this is a rollout step.

The list only grows. Because branching lives in the filesystem, a new engine is a rollout step, not a rebuild.

Same idea as Neon, one layer down

Neon and PlanetScale proved that developers want to fork a database the way they fork code. The two approaches just put the branch in different places.

Neon and PlanetScale

Branching is built into a custom storage engine, deep inside one database. Neon rebuilt Postgres storage on a copy-on-write layer; PlanetScale did their own for MySQL. Both are genuinely strong engineering, and both stop at the engine they were built for.

Layerbase

Branching lives below the database, in the filesystem's copy-on-write clones. The engine never learns it was cloned, so one Branch button covers 9 engines. You get the same instant, isolated branch with its own connection string. The difference is how many engines get to use it.

Database branching questions

How does database branching work?+

A branch is a copy-on-write clone of the database files, not a feature inside the engine. Layerbase stops the source just long enough to take a consistent snapshot of its data directory, clones it copy-on-write on ZFS, and starts the clone on its own port. The engine boots against a normal data directory and never knows it was forked. Because the trick lives in the filesystem, the same mechanism works for every engine on the list.

Which databases can Layerbase branch?+

Branching is live on 9 engines: PostgreSQL, MySQL, MariaDB, Redis, Valkey, FerretDB, LibSQL, SQLite, and DuckDB. The relational and key-value engines branch by cloning their data directory; SQLite and DuckDB branch by copying their backing file. More engines move onto the branching storage as the rollout continues.

Can you branch a MySQL database?+

Yes. MySQL and MariaDB both branch. You get a full, isolated copy with its own connection string, which is the piece PlanetScale-style branching gives you for MySQL, except here it runs the same way as the Postgres, Redis, and DuckDB branches next to it.

Can you branch MongoDB?+

MongoDB itself is not branchable yet, because it writes its configuration after the container starts and the branch copy runs before that step. FerretDB is the answer today: it speaks the MongoDB wire protocol, so you point your existing Mongo driver at a FerretDB branch and it works. That gives you Mongo-compatible branching now while MongoDB itself is on the roadmap.

Does a branch double my storage cost?+

No. A fresh branch shares its parent blocks and writes nothing new until you change something. Only the blocks that diverge cost storage, and the total is bounded by your plan storage quota, not by the size of the parent. Branch a 5 GB database and change one table, and you pay for that one table.

How many branches can I create?+

The free tier allows one branch per database, Solo allows three, and Pro and Team plans allow up to ten per database. You can branch a branch to capture a known-good checkpoint, and each one counts toward that per-database limit.

Branch the database you actually have

Create a database, add data, and hit Branch. The free tier includes branching, so you can try the whole loop before you pay anything.