Adding a new column is one of the most common schema changes. Done right, it is fast, safe, and easy to roll back. Done wrong, it locks tables, blocks writes, and drops performance.
Start by defining the new column in a migration script. Use a tool that supports transactional schema changes when your database allows it. For large tables, avoid backfilling the new column in the same migration. Add it empty, deploy, and populate it in small batches to reduce lock times.
Choose the correct data type for the new column. Keep it as narrow as possible. Small, well-defined types use less storage, improve cache hit rates, and speed up queries. For text fields, size them to actual needs instead of defaulting to wide values.
Decide on default values and nullability with care. Setting a non-null with a default can rewrite the entire table. If you must do this, test on production-sized data first. When possible, make the column nullable, deploy, populate, and then alter to non-null in a follow-up step.