Safe Database Migrations with the Expand-and-Contract Pattern
A schema migration can be syntactically correct and still cause an outage. Production deployments often run old and new application versions at the same time, background workers may lag behind, and a large table can turn a simple-looking DDL statement into a long lock.
The expand-and-contract pattern reduces those risks by splitting an incompatible change into compatible stages.
Why one-step schema changes are risky Suppose an application wants to rename users.full_name to users.display_name.