You need to add a new column, but every second of downtime costs money and trust. The wrong migration strategy will lock tables, block writes, and stall your application.
A new column in a database table seems simple. It isn’t. At small scale, you might alter schema directly. At high load, that same ALTER TABLE can block thousands of transactions. The challenge is adding a new column without risk, without downtime, and without stale replicas.
First, inspect the target table’s size and indexes. In MySQL and PostgreSQL, adding a column with a default value can rewrite the whole table. On large tables, this causes immediate locks. Instead, add the column as nullable with no default. Then backfill the data in controlled batches. Use write queues or application-level migrations to scale the process.
Next, ensure your application code is ready to read from both old and new schema states. Deploy schema changes before code changes that write to the new column. This forward-compatible approach avoids errors during staggered rollouts.