Adding a new column is simple in theory. In practice, it risks downtime, lock contention, or breaking queries that run in real time. The steps to add a column depend on schema size, table load, and compatibility with existing code. Even a single ALTER TABLE command can freeze an active system if executed without care.
The safest approach begins with understanding the database engine. In PostgreSQL, adding a nullable column without a default is instant. In MySQL, the same operation may lock the table. If a column needs a default value, apply it in a separate migration to avoid long-running locks. Always check whether you can backfill in batches to prevent write amplification.
A new column changes not just the schema, but the contract between services. Update application code to handle both old and new states during the migration window. Deploy application changes in stages. First, ensure reads can handle NULL values. Then write to the new column without yet relying on it. Only after data integrity is confirmed should the system depend on that column for critical paths.