When you add a new column to a table, you are modifying the contract between your application and its database. In SQL, this is done with ALTER TABLE. It sounds simple. It isn’t. Every environment, from local development to production, will carry its own risks—locks, replication lag, migration downtime, and hidden type mismatches.
Before running ALTER TABLE ... ADD COLUMN, you need to decide on the column’s type, nullability, default values, and indexing strategy. Nullable columns can ship fast but often require careful handling in code. Non-null columns with defaults avoid null checks but can trigger a heavy rewrite of existing rows.
In relational databases like PostgreSQL and MySQL, adding a new column without a default is often fast because it updates metadata only. But adding a column with a non-null default can rewrite the entire table, impacting performance for large datasets. In distributed systems or multi-tenant architectures, this can cascade into query failures and degraded APIs if not planned.