Adding a new column sounds simple, but the wrong approach can slow queries, block writes, or even take an application offline. The key is choosing the right method for your database engine, schema design, and traffic pattern. Done right, you can evolve your data model without downtime.
In SQL databases like PostgreSQL or MySQL, a new column can be created using the ALTER TABLE statement. On smaller datasets, a basic ALTER TABLE my_table ADD COLUMN new_column_name datatype; is enough. For large, production-grade tables, online schema changes or tools like pg_online_schema_change or gh-ost ensure the operation is non-blocking. These tools create a shadow table, copy data in the background, and swap references with minimal locks.
When adding a new column, define whether it needs a default value or can be NULL. Backfilling large amounts of data should be done in batches to reduce transaction load. For indexed columns, defer index creation until after the column and data are in place to avoid compounding write costs.