Adding a new column should be simple. In practice, it can block writes, lock tables, and stall deployments. Schema changes are small by code size, large by operational risk. The wrong approach turns a one-minute task into downtime.
A new column in SQL starts with an ALTER TABLE command. On small datasets, it’s instant. At scale, it can scan and rewrite millions or billions of rows. This locks the table or runs long background processes, depending on your engine. The result: delayed releases, frustrated teams, and potential production incidents.
Different databases handle this differently. PostgreSQL new column defaults to adding columns with NULL values instantly, but adding a default value before version 11 rewrote the whole table. MySQL new column can perform an in-place operation for some cases, but not all—especially with NOT NULL constraints or indexes. MongoDB new field is schema-less, but backfilling data still takes time and resources.
Safe rollout patterns are well known but often skipped under time pressure. The core steps: