Adding a new column to a database table is routine, but it is also one of the most dangerous operations in production. Done wrong, it can lead to downtime, broken queries, and delayed deployments. Done right, it can ship in seconds without risk.
When you add a new column, your first decision is its default. Setting a non-null default on a large table will lock rows and block writes. Instead, create the column as nullable, deploy, then backfill data in small batches. Once it’s populated, alter it to be non-null with the default in place. This keeps the table online under high load.
Indexes can’t be an afterthought. Adding an index to a new column without planning can trigger massive disk writes and degraded performance. Build the index concurrently, or in a rolling migration, to keep queries responsive. Test the impact with production-like load before rollout.