NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›
BRANCHING

Branch a database like code.

A branch is a consistent copy of a live database, made while the parent keeps taking writes, or of any past point in the S3 archive. Work on it, diff it against the parent, then merge it back in one transaction, reset it, promote it or drop it.

HOW IT WORKS · ANIMATED 12 s cycle

Branch production, change it, merge it back

A branch is a consistent copy of a live database, made while the parent keeps taking writes. It keeps a merge base, so a three-way diff shows exactly what a merge would do.

PROD PREVIEW · BRANCHCREATE BRANCH preview FROM prod ADD COLUMN eta UPDATE 120 rows INSERT 8 SHOW BRANCH DIFF preview orders +1 column · 120 updated · 8 inserted conflicts 0 MERGE BRANCH preview INTO prod✓ one transactionON CONFLICT FAIL · BRANCH WINS · PARENT WINS or: RESET · PROMOTE · DROP
  1. 1
    Production keeps writing

    prod takes writes the whole time; nothing pauses.

  2. 2
    CREATE BRANCH preview

    A consistent copy as of now, with its roles, indexes and partitions, and a merge base.

  3. 3
    The branch diverges

    A migration adds a column on preview and rewrites some rows.

  4. 4
    SHOW BRANCH DIFF

    Per table: schema changes, inserts, updates, deletes, and rows both sides changed.

  5. 5
    MERGE BRANCH

    Applied to prod in one transaction. ON CONFLICT FAIL refuses if both sides changed a row.

  6. 6
    Or reset, promote, drop

    RESET re-copies the parent; PROMOTE swaps them by name; DROP throws the branch away.

1 / 3

Six statements

CREATE DATABASE dev TEMPLATE prod is PostgreSQL's spelling of the same copy. A branch is an ordinary database: connect to it by name; its roles, sequences, indexes and partitions came with it.

SQL
CREATE BRANCH preview FROM prod;
CREATE BRANCH incident FROM prod AS OF TIMESTAMP '2026-11-19 10:00+00';
SHOW BRANCH DIFF preview;
MERGE BRANCH preview INTO prod ON CONFLICT FAIL;
RESET BRANCH preview;
PROMOTE BRANCH preview;
2 / 3

Three-way merge, with conflicts you can see

A branch keeps its merge base. SHOW BRANCH DIFF reports, per table, the schema changes, inserts, updates and deletes a merge would apply, and every row both sides changed. MERGE applies them in one transaction: fail on a conflict, or let the branch or the parent win.

  • Schema changes replayed in order
  • Rows matched by key, three ways
  • ALLOW DROP must be said to drop a table
  • Branches of branches: a tree, shown in SHOW BRANCHES and rdb_studio
3 / 3

What teams do with it

  • A database per pull request, merged with the code
  • Rehearse a migration on yesterday's data, then promote
  • Branch from before an incident, copy back only what was lost
  • Hand analysts a copy that cannot touch production
✓ page rendered in 126 µs axum + tera + htmx · no other javascript