Adding a new column sounds simple. In practice, it can be one of the most dangerous schema changes you make. A poorly executed ALTER TABLE on a large dataset can lock writes, consume massive I/O, and cause downtime. The challenge grows with foreign keys, indexes, and live traffic hitting the database.
Start with a plan. Determine the exact column name, type, nullability, and default value. Check if the database can handle the operation online. PostgreSQL supports ALTER TABLE ADD COLUMN quickly if no default is applied; MySQL requires care depending on the storage engine and version.
Run migrations in a controlled environment before production. Use feature flags to separate schema changes from application logic. In some cases, backfill data in batches to avoid spikes in load. Test performance impacts with representative queries.