PostgreSQL pgroll: Zero-Downtime, Reversible Migrations
summary
pgroll is a Go single-binary CLI that applies PostgreSQL (14+) schema changes by creating virtual schemas and shadow tables, using triggers and transaction tracking to serve old and new schemas simultaneously. It performs automatic backfill of data, exposes start/status/complete/rollback commands (rollback works until a final complete is run), and targets zero service impact via zero-downtime migrations. Limitations: migration inputs are JSON files (no batch file import yet) and builds from source require Go 1.23+.
AI-written summary · about
chapters (11)
- 0:00Introduction and speaker
- 1:48Challenges of online schema changes
- 6:01What is pgroll and its benefits
- 9:34How pgroll works in the background
- 11:21Expand contract workflow explained
- 14:56Schema versions during migration
- 18:50Installing and configuring pgroll
- 21:14Using pgroll with JSON change files
- 23:40Adding columns and constraints
- 25:45Comparison with other tools
- 28:12Q&A session begins
related talks
43mPostgres schema migrations using the expand/contract pattern
28mBringing PostgreSQL towards zero downtime migration with Python
52mManaging PostgreSQL changes for the Agile DBA
30mPuny to Powerful PostgreSQL Rails Apps
37mDatabase Schema Migrations with Zero Downtime
01h 41mPostgreSQL Upgrades with Logical Replication & Minimal Downtime
48mMigrating to PostgreSQL: Strategies, Sovereignty, and Success
50mAn ultimate guide to upgrading your PostgreSQL installation
