Adding a new column to a database table is simple to describe and easy to ruin. Done carelessly, it locks tables, slows queries, and disrupts production. Done well, it extends your schema without risk.
A new column can store new metrics, flags, or computed values. In SQL, the operation starts with ALTER TABLE. Example for PostgreSQL:
ALTER TABLE orders ADD COLUMN processed_at TIMESTAMP WITH TIME ZONE;
This is only the start. On large tables, adding a new column with a default value in a single statement can lock the table and block reads and writes. To avoid downtime, add the column first, without defaults. Backfill data in small batches. Apply defaults later with UPDATE and ALTER COLUMN SET DEFAULT.
If the new column needs constraints or indexes, add them after the data is in place. Postpone expensive operations until traffic is low. For non-null constraints, fill values for all rows before applying.