Adding a new column sounds simple. In practice, it is a change that touches data integrity, query performance, and application logic. The wrong step can lock a table, spike CPU usage, or break production code. The right step makes the system stronger without downtime.
First, define the purpose of the new column. Know its type, size, constraints, and default values before touching the schema. This reduces later migrations and avoids null-related bugs.
Second, choose the migration strategy based on table size and traffic. For small tables, an ALTER TABLE command may complete in milliseconds. For large tables, use online schema change tools or phased rollouts to avoid blocking writes. Monitor disk usage, replication lag, and query latency during the change.
Third, update your application code in a controlled sequence. Add the column to the database. Deploy code that writes to both the new and old columns if you are running a backfill. Then switch reads when the data is complete. Remove old code paths after verification.