TLDR Web Dev · ARTICLES & TUTORIALS

A MAJOR POSTGRES UPGRADE WITH ZERO DOWNTIME

instantdb.com18 min read

Summary from the TLDR Web Dev newsletter

Instant, a Firebase alternative, successfully performed a zero-downtime major Postgres upgrade from version 13 to 16. Initial attempts using in-place upgrades and blue-green deployments failed due to downtime constraints and incompatibility with active replication slots. Instant used a manual process that involved creating a new Postgres 16 replica from scratch, carefully switching subscriptions, and writing a custom zero-downtime algorithm, which paused new transactions, waited for active ones to complete, and then switched writes to the new instance.