GitLab's PostgreSQL Patterns for Zero-Downtime Schema Migrations at Scale
Simple schema changes that finish instantly on small databases can cause major outages on large production PostgreSQL systems with billions of rows. Table-level locks taken during ALTER TABLE operations can queue behind long-running queries, blocking all subsequent traffic and exhausting connection pools. GitLab mitigates this by setting strict lock and statement timeouts so migrations abort quickly and can be retried safely. Its helpers also build indexes concurrently to avoid blocking writes, and it removes columns through a multi-release process that first stops application code from using them.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in