Adding a new column to a production database is not just a schema change. It is an operation with performance, compatibility, and deployment risks. Your goal is to make the change safely, keep downtime at zero, and ensure your application code can handle both old and new schema states during the rollout.
First, define exactly what the new column will hold. Choose a name that follows your naming conventions. Decide on the data type. Keep it as tight as possible: avoid oversized types that waste storage or hurt cache performance. Add NOT NULL constraints only after the column is populated, unless you can guarantee backfill during the migration step.
Next, plan the migration. On large tables, an ALTER TABLE ADD COLUMN can lock writes for an extended period. To avoid blocking, use online schema change tools like pt-online-schema-change or gh-ost. Test the migration with production-sized data on a staging environment. Measure how long it takes and monitor index rebuilds if the new column is part of any composite keys.
If the new column will store derived data, consider adding it without triggers. Recompute batches with a background job to avoid slowing down inserts. Only create indexes on the new column after confirming query patterns that justify them. Every index is overhead; every index slows writes.