Adding a new column is simple in theory, lethal in practice. Schema changes lock tables, block writes, stall deployments. In high-throughput systems, a poorly timed migration can take down production in seconds. The key is to treat it as a controlled operation, not a casual edit.
First, decide the type and constraints before touching anything. Nullable or default values can prevent breaking existing queries. Avoid altering massive tables in one transaction—use phased migrations. Add the column, backfill in batches, then flip constraints when safe.
For systems with zero tolerance for downtime, run online migrations. Tools like pt-online-schema-change or native database features can create new columns while traffic flows. Model the impact carefully. Test exact queries you expect to run after the change.