Skip to content

Cloud & DevOps · Open-source build

Zero-downtime PostgreSQL migrations

Schema changes that run while the application keeps serving traffic, with the old and new shape live at the same time until the cutover is proven.

Built on
pgroll
Licence
Apache-2.0
Provenance
Open-source build

What it is

pgroll applies each migration through an expand-and-contract cycle: it adds the new columns and views, backfills in batches, serves both versions through versioned schemas, and contracts only after the new application version is healthy. Logical replication carries the same approach across to a new database instance.

What the build consists of

  1. 01pgroll migrations with versioned schemas, so two application versions coexist
  2. 02Batched backfills throttled against replication lag
  3. 03Logical replication from the source instance to the target, with row-count reconciliation
  4. 04A cutover runbook rehearsed on a copy of production data
  5. 05Rollback verified at every step, not assumed

What you see in a demo

Renaming a column on a table under sustained write load without a failed request. It is the migration that most teams schedule a maintenance window for.