Adding a new column to a database table should be simple. Yet in production, it carries risks—schema lock, downtime, migration failure, and broken code paths. To do it well, you need a plan that fits the shape of your system and the volume of your traffic.
Start with clarity on the target state. Define the column name, data type, default value, and whether it allows nulls. Document every detail. Then choose the safest migration strategy. For small datasets, an ALTER TABLE ADD COLUMN with sensible defaults may be enough. For large datasets, use an online schema change tool to avoid locking the table.
If the new column needs to be populated from existing data, run a backfill in controlled batches. Monitor I/O, replication lag, and error rates. Avoid long transactions. Deploy the schema change first, then deploy code that writes to the new column, and only then deploy reads from it. This three-phase approach keeps old and new code compatible until the cutover.