A new column can be a minor patch or a breaking change. It changes how the database stores, retrieves, and indexes information. It touches queries, APIs, and clients. Done right, it’s invisible to the user. Done wrong, it’s a production outage.
Before adding a new column, confirm the reason. Is it for new functionality, performance optimization, or compliance? Define the exact type, constraints, and default values. Avoid nullable columns unless they have a clear purpose. Plan for how this column will interact with existing indexes.
Migrations must be safe. On large datasets, a blocking ALTER TABLE can lock writes for minutes or hours. Use online schema changes or phased rollouts. Create the column first, backfill data in batches, then apply constraints once the data is ready. Monitor query plans to prevent regressions.
Application code should handle the new column gracefully. Read paths should check for its existence where applicable. Write paths should not break if the column is still null during rollout. Keep backward compatibility until all services are updated.