Adding a new column sounds simple. It isn’t. Schema changes in production can block writes, lock rows, or spike CPU. For high-traffic systems, a badly planned column addition can take your service down. The right approach is deliberate, tested, and built for zero downtime.
First, clarify the column definition. Pick the correct data type, set defaults carefully, and decide if NULL is allowed. Adding a non-nullable column with a default can rewrite an entire table. On large datasets, that means a full table lock.
Next, choose the safe DDL strategy. Some databases, like PostgreSQL, allow fast column additions if no on-disk rewrite is needed. Others, like MySQL without ALGORITHM=INSTANT, require background migrations. Tools like pt-online-schema-change or gh-ost can help stream changes in small chunks.