Adding a new column looks simple in code. One migration, a schema change, a push. But in production, every detail matters. Schema updates can lock tables, block writes, and slow reads. On high-traffic systems, an unsafe ALTER can cascade into outages. The bigger the table, the higher the stakes.
The first rule: plan the new column with precision. Decide on its data type, default value, and nullability before you write the migration. Unbounded strings turn into storage bloat. Wrong defaults force expensive rewrites.
For large datasets, online migrations are often the safest route. Many teams use tools like pt-online-schema-change, gh-ost, or built-in database features for concurrent column addition. These let you add the new column without locking the table, by creating a shadow copy and switching over with minimal downtime.
Index creation deserves separate planning. If the new column needs an index, build it after the column exists to control impact. Creating both in a single migration can compound resource usage.