Adding a new column is one of the most common schema changes in development. It seems straightforward, but the impact touches queries, indexes, migrations, and application logic. The wrong approach can create downtime, lock tables, or cause unpredictable failures in production.
Before creating a new column, decide its type, default value, and whether it can be null. These choices determine how data behaves now and in the future. For large datasets, adding a column with a default can cause massive write operations. Avoid this by adding the column without a default, then backfilling in controlled batches.
For relational databases like PostgreSQL, use ALTER TABLE with caution. Adding a nullable column is fast, but adding one with constraints or indexes can block writes until the operation finishes. On MySQL, the cost and locking behavior depend on the storage engine. Modern engines support online DDL, but you must verify the exact behavior before touching production.