Zero-Downtime Database Migrations for PostgreSQL
Practical techniques for changing schemas on busy PostgreSQL databases without taking the app down, including expand-and-contract, online DDL, and safe backfills.
Zero-Downtime Database Migrations for PostgreSQL
Practical techniques for changing schemas on busy PostgreSQL databases without taking the app down, including expand-and-contract, online DDL, and safe backfills.
Why do schema migrations on a busy PostgreSQL table often cause outages even when the change looks small?
Most `ALTER TABLE` statements take an `ACCESS EXCLUSIVE` lock. That blocks every read and write until the migration finishes. On a hot table, even a 200ms lock can pile up thousands of waiting queries, exhaust the connection pool, and take the app down. The migration itself runs fine. The queue of blocked queries is what breaks production.
More flashcard decks
Cloud Architecture
Multi-Region Active-Active Architecture on AWS
Patterns and trade-offs for running active-active workloads across AWS regions: routing, data replication, conflict resolution, and what it actually costs you in complexity.
25 minutes
Service Mesh
Service Mesh Traffic Management with Istio
Learn how to configure advanced traffic management policies in Istio including weighted routing, automatic retries, and circuit breaker patterns for production services.
25 minutes
Also worth your time on this topic
Zero-Downtime PostgreSQL Migrations in Production
How to change a live PostgreSQL schema without taking the app down: the expand-and-contract pattern, online DDL with CONCURRENTLY and NOT VALID, batched backfills, and the lock monitoring that lets you do it with confidence.
2-4 hours
Zero-Downtime PostgreSQL Migrations Quiz
Test your skills shipping schema changes against a live PostgreSQL database without dropping traffic, breaking deploys, or locking out writers.
20-25 minutes
GitOps with ArgoCD - Automated Kubernetes Deployments
Implement GitOps workflows using ArgoCD for automated, declarative, and auditable Kubernetes application deployments.
120 minutes