Adding a new column in a production database is not just a schema change. It impacts queries, indexes, migrations, and the shape of your API responses. Done right, it unlocks features. Done wrong, it causes downtime.
First, decide on the column name and data type. Keep it short, consistent, and predictable. Use the smallest data type that fits the data. Changing it later will be harder than adding it now.
Then, plan the migration. For large tables, adding a new column with a default value can lock writes. In PostgreSQL, adding a nullable column without a default is instant. Populate it in batches. In MySQL, check the engine and version—some support instant adds, some don’t.
Update your indexes only when needed. Adding an index during the same migration can double-lock the table. Create the column first, backfill the data, then add the index in a separate step.