Adding a new column should be simple. In reality, it can lock tables, stall writes, or trigger expensive rewrites. On small datasets, this happens fast. On billions of rows, it can bring everything to a halt.
When you add a new column in SQL, the database updates the table schema. Depending on the engine—PostgreSQL, MySQL, or others—this may require rewriting the table on disk. PostgreSQL can add a nullable column without default almost instantly, but a column with a default value forces a full rewrite. MySQL’s behavior varies with storage engine and version; InnoDB may handle certain changes online, but not all.
For large systems, add columns during low-traffic windows or use phased rollouts. One pattern is to first add the new column as nullable, then backfill data in small batches, then apply constraints. Avoid adding NOT NULL with default in one step on massive tables.