Adding a new column sounds simple. In production, it can be risky. Locks block writes. Migrations stall traffic. A careless ALTER statement can take down your service. The way you add a column defines whether the change is smooth or a crisis.
Start by assessing the table size. Millions of rows? Billions? Online migrations are safer for large datasets. Tools like pt-online-schema-change or gh-ost copy data in chunks and swap tables without locking. Choose the method that avoids full table locks.
Pick a clear column name. Avoid keywords. Keep it consistent with naming conventions. Decisions here cost more to change later than the column data type.
Set a default only if essential. Adding defaults on large tables can rewrite the entire table. Null may be safer until you backfill data. Use batched updates to fill the column without stressing the database.