Adding a new column is a routine operation, but the way you do it defines whether your system stays online or burns under load. Schema changes can lock tables. Migrations can block writes. Downtime costs money. If you need a new column in a production database, the process must be safe, fast, and reversible.
Start with your migration plan. Always check column defaults. Adding a non-null column with a default value can trigger a full table rewrite. That means locks, high I/O, and a spike in CPU usage. Instead, add the new column as nullable. Then backfill in small batches using an id or timestamp as a cursor. This keeps writes hot and minimizes transaction contention.
Choose column types with care. A wrong type leads to implicit casting in queries, which hurts performance. In PostgreSQL, adding a new column without a default is a metadata-only operation. In MySQL, online DDL options can help, but not every storage engine supports them. Testing the DDL on production-like replicas is mandatory before touching the live system.