Adding a new column is simple in theory, but the details decide whether you ship fast or sink in downtime. This is more than running an ALTER TABLE statement. It’s about controlling risk, preserving performance, and preparing for rollback.
First, define the purpose of the new column. Specify its type, constraints, and default values with precision. Avoid nullable columns if they will always hold data. Use defaults to keep writes consistent as soon as the column exists.
Next, run the schema migration in a way that will not lock your application. On large tables, a blocking alter can stall reads and writes. Use tools or migration strategies that apply the change online. In many relational systems, adding a new column with a default can rewrite the table, so separate the steps: add the column without the default, backfill data in batches, then add the default constraint.