Headline: A Postgres migration usually takes an app down not because the DDL is slow, but because ALTER TABLE waits for an ACCESS EXCLUSIVE lock and every query that arrives after it waits in the same lock queue. Setting a short lock_timeout , splitting every breaking change into expand/backfill...

Source: [Dev.to](https://dev.to/ahmed_mahmoud360/zero-downtime-postgres-migrations-field-notes-on-expandcontract-locktimeout-and-the-alter-3d3m)

Sponsored