Adding a new column can be trivial, or it can break production if done carelessly. The method depends on the database engine, data size, and deployment workflow. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward, but with large tables, even this can lock writes. MySQL and MariaDB often require special handling to avoid blocking operations. For high-traffic systems, online schema change tools like gh-ost or pt-online-schema-change are common.
Always define the column type with precision. Choices like TEXT vs VARCHAR or TIMESTAMP WITH TIME ZONE vs TIMESTAMP WITHOUT TIME ZONE matter for storage, performance, and application logic. Decide if the new column should allow NULL values. Default values can be useful, but adding them in the same operation can increase migration time dramatically.
In production, test migrations in a staging environment with realistic data. Benchmark the ALTER TABLE process. Watch for implicit table rewrites. For massive datasets, break the change into steps: first add the column as nullable, then backfill in batches, then enforce constraints.