Adding a new column can look simple. In practice, the wrong move can lock tables, block queries, and break live code. On small data sets, an ALTER TABLE runs in seconds. On production-scale systems, it risks downtime and degraded performance.
Before creating a new column, define its purpose and constraints. Decide on data type, nullability, and defaults up front. Changing these later is expensive. Use consistent naming conventions to avoid confusion across migrations.
When altering large tables, consider an online schema change process. Tools like pt-online-schema-change or native database features let you add a column without locking writes. Run the change on a replica or in a staging environment first. Check query execution plans to ensure the new column does not slow common reads.