DEVOURED
Zero-downtime Postgres upgrades with logical replication
PostgreSQL major version upgrades can achieve sub-200ms downtime by using logical replication for continuous data migration.
What: Dimitri Fontaine demonstrates a zero-downtime upgrade strategy using logical replication and reverse subscriptions to ensure a rollback path, achieving a 181ms write stall during cutover.
Why it matters: This method replaces long maintenance windows with a repeatable, testable cutover event, providing a safer and faster alternative to traditional dump-and-restore or in-place upgrades.
Takeaway: Test your cutover procedure using actual data volumes in a staging environment to identify your specific write stall time before production execution.
Deep dive
- Logical Replication: Replicating data changes based on replication identity rather than physical file blocks.
- RTO (Recovery Time Objective): The duration a service is unavailable during migration.
- RPO (Recovery Point Objective): The amount of data lost during a switchover.
- PAUSE/RESUME: pgbouncer command to hold application queries without dropping client TCP connections.
Decoder
- Logical Replication: A method of replicating data objects and their changes based on their replication identity (usually a primary key).
- WAL (Write-Ahead Log): The transaction log in Postgres that records all changes.
- pg_upgrade --link: A Postgres utility that performs upgrades by hard-linking data files instead of copying them.
Original article
Full article content is not available for inline reading.
Explore all 53 articles in today's digest
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi