Adding a new column to a database is simple to describe and tricky to do well. Schema changes can stall deployments, lock writes, or break downstream code. It is not just ALTER TABLE—it is migration strategy, indexing, data backfill, and rollback plans.
Start with the schema change itself. In most SQL dialects, adding a nullable column is fast and safe because it updates only metadata. Adding a non-null column with a default can be slow on large tables because the database writes every row. Measure the cost before you run the command.
If you need a default value, consider adding the column as nullable first. Backfill data in batches. Then set the NOT NULL constraint. This avoids long locks and reduces the risk of downtime.
In distributed systems, coordinate schema migrations with deployments. Add the new column first. Deploy code that reads it but does not require it. Populate the data. Then deploy code that writes the new column. Finally, enforce constraints.