Changing a production database is rarely just a database operation. The application code running during the change may expect the old schema, while a newly deployed version may depend on a new one. Background workers, scheduled jobs, and older application instances can make the transition more complicated.
A migration that works perfectly in a development environment can still cause production errors if the application and database move to their new states at different times.
Zero-downtime database migration is about managing that transition so the service can continue handling requests while the schema and data evolve.
Why a single-step migration is risky
Imagine an application that stores a customer's name in a column called full_name. A team wants to replace it with separate first_name and last_name columns.
The simplest approach might be to rename the column, update the application code, and deploy everything together. But production systems often run multiple application instances.…