Adding a new column sounds simple. In production, it can be dangerous. Schema changes can block writes, cause downtime, or break code in subtle ways. The key is to plan, test, and deploy without interrupting live traffic.
Start by defining the new column with safe defaults. Avoid adding NOT NULL constraints on creation unless you can populate values instantly. Use database tools that support online DDL operations, such as ALTER TABLE ... ADD COLUMN with non-blocking modes in MySQL or ADD COLUMN in PostgreSQL. This prevents locks on large tables.
After adding the column, backfill data in small batches. Monitor query performance during the backfill to ensure indexes and cache hit rates stay stable. Avoid long transactions that can bloat write-ahead logs or replication lag.