The commit landed at midnight. By morning, a new column existed in production, shaping data that billions of rows now had to obey.
Adding a new column is one of the most common schema changes in modern applications. It looks simple. It isn’t. The wrong approach can lock tables, cause downtime, or leave your systems in an inconsistent state.
First, choose the correct data type. A misaligned type will break queries and slow ingestion. Next, decide on defaults. Adding a new column with a non-null default to a large table can force a full rewrite of storage. This is costly in both time and I/O.
Use online schema changes when possible. Many databases offer features like ADD COLUMN without locking reads or writes, but behavior differs between MySQL, PostgreSQL, and distributed databases. Test your migration path on production-like data before pushing live.