Adding a new column sounds simple. It isn’t. Schema changes can block writes, lock tables, and burn deployment windows. At scale, one bad migration means downtime, data loss, or both. Fast code is worthless if the database can’t keep up.
A new column should be deliberate. Decide the type—integer, text, JSONB—based on real constraints. Nullability is never just a toggle. It affects query plans, storage, and application logic. Default values may speed up some operations but slow down large table rewrites.
The method matters. Online schema migration tools like gh-ost or pt-online-schema-change stream updates without blocking traffic. Feature flags can control when application code starts reading or writing the column. Rolling out a new column in phases—create, backfill, switch—is safer than all-at-once changes.