Adding a new column sounds simple. In reality, it can break queries, lock tables, and cause downtime if handled poorly. The key is planning. Decide the column’s type, default, and nullability before touching the schema. Avoid wide varchar without need. Set defaults to prevent null errors.
For large tables, adding a column can block writes for seconds or minutes. Use online schema change tools like gh-ost or pt-online-schema-change to avoid locking. Test these in staging with production-sized data. Measure query times before and after.
If the new column is part of an index, sequence the operations: add the column, backfill data in small batches, then add the index. Never backfill in a single transaction. Watch replication lag if you use replicas.