A simple ask, but one with hidden traps. Adding a new column to a live database is never just typing ALTER TABLE. It touches schema design, query performance, data backfill, replication lag, and deployment strategy. Done wrong, it risks downtime or inconsistent data.
When adding a new column, start by defining exactly what it will store and why it belongs in the table. Check normalization rules. Avoid mixing concerns. Use the smallest data type that fits the requirement to save storage and memory. Decide if the column should allow NULL or have a default value, but remember: in large tables, setting a default with ALTER TABLE can lock writes.
For high-traffic databases, create the column without a default, then backfill in batches. This avoids long locks and keeps queries responsive. Tools like pt-online-schema-change or native online DDL features can apply schema changes without blocking. Always measure the performance impact with EXPLAIN plans after the change.