Adding a new column is one of the most common schema changes in a production database. It sounds small. It can be dangerous. The wrong migration can lock tables, spike CPU, or block writes under load. The right one slips into place without anyone noticing.
Before adding a new column, decide exactly what it will store and how it will be used in queries. Choose the smallest data type that fits. A boolean is smaller than an integer. A VARCHAR(50) is cheaper than TEXT. The more precise the type, the faster the scan.
Default values are tricky. Setting a default and NOT NULL on a huge table can rewrite every row, causing long locks. Instead, add the column as nullable, backfill rows in small batches, then add constraints later. This reduces risk and keeps your database online.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable columns without defaults. In MySQL, the performance depends on the storage engine and version, but online DDL can help avoid downtime. Read your database’s documentation before running a migration in production.