Adding a new column sounds simple. It rarely is. In production, schema changes demand precision. A single misstep can lock tables, stall queries, or take down APIs. The safest path is deliberate, staged, and reversible.
First, define the new column with the correct type and nullability. Make it nullable at the start to avoid blocking writes. Migrations that alter big tables should use online DDL or tools like pt-online-schema-change or native database features. This keeps the service responsive while the structure updates.
Second, backfill data in controlled batches. Watch CPU, memory, and replication lag. Do not push everything at once. If you store computed values, verify they match expected results before switching reads to the new column.
Third, deploy code that writes to both the old and new columns. This dual write ensures new data is available no matter which column is queried. Once you have 100% coverage and full backfill, cut reads over to the new column.