The safest fix is fast, deliberate, and tested. Adding a new column sounds simple, but in systems with terabytes of data and zero downtime requirements, it requires precision.
A database migration that adds a new column affects storage, indexes, query plans, and application code. Without planning, the change can lock tables, cause replication lag, or trigger expensive full table rewrites. The right approach depends on the database engine, table size, and traffic profile.
For PostgreSQL, a new nullable column with no default is instant. Adding a column with a default rewrites the table and can block writes. Use ALTER TABLE ... ADD COLUMN without a default, then UPDATE in batches if pre-filling data is required. MySQL behaves differently: adding a column can be a metadata-only change in recent versions, but large tables on older versions still incur full copies. Online DDL tools like pt-online-schema-change or gh-ost mitigate the impact.