Adding a new column to a database sounds simple. It is not. Done wrong, it can lock tables, stall traffic, or corrupt data. Done right, it is seamless and invisible to the end user. The key is understanding structure, constraints, and performance before you write a single migration.
Start with a schema review. Check how the new column will interact with indexes, foreign keys, and triggers. Decide on the column type with care. In PostgreSQL, adding a nullable column with a default is fast if the default is set in the application layer, but can rewrite the whole table if set in the migration. In MySQL, adding a column to the middle of the table forces a full table copy.
Plan for concurrency. On high-traffic systems, use an online schema change tool like pt-online-schema-change or gh-ost. These tools copy data to a shadow table, sync changes, and then switch with minimal downtime. Always test against production-like data volumes to reveal hidden locking or performance problems.