Adding a new column to a database seems simple, but the wrong approach can lock tables, spike CPU, and make users wait. In production, even a few seconds of downtime can trigger failures upstream. The key is choosing the right method for your schema, your data size, and your deployment pipeline.
For relational databases like PostgreSQL, ALTER TABLE ADD COLUMN is the fastest way to define a new column with a default of NULL. This avoids a full table rewrite. If you must set a default value, consider adding the column first, then backfilling in small batches to prevent blocking queries.
In MySQL, adding a nullable new column is also metadata-only for certain storage engines, but any non-null default can rewrite every row. On large tables, this can cascade into service latency. Tools like pt-online-schema-change or gh-ost can help you apply new columns online without halting traffic.