The table was failing. Query times climbed. Columns meant for one purpose were now doing the work of many.
Adding a new column sounds simple. It rarely is. In production, a schema change can block writes, lock reads, or break code paths you forgot existed. Choosing the right path for adding a new column to a relational database—PostgreSQL, MySQL, MariaDB—can mean the difference between a smooth rollout and an outage.
Start by asking if the column is nullable, has a default, or requires backfilling. For large datasets, adding a NOT NULL column with a default will rewrite the entire table. This is expensive and may block queries. Instead, add the column as nullable first, backfill data in small batches, then apply constraints in a later migration.
Use transactional DDL if your database supports it. This ensures that the new column addition is atomic and either fully applies or fully rolls back. In PostgreSQL, ALTER TABLE ... ADD COLUMN is usually fast for nullable columns without defaults. For indexed columns, create the index concurrently to avoid locking writes.