The database felt slow, and the logs told you why: a missing column in the right place. You need a new column, but not later—now.
Adding a new column is one of the most common schema changes, but it can still wreck uptime if handled poorly. The right approach depends on your database engine, table size, and traffic pattern. In Postgres, an ALTER TABLE ... ADD COLUMN with a default value rewrites the whole table. For large datasets, that means blocking writes and locking reads. MySQL has similar pitfalls, though modern versions use instant DDL for many cases.
The safest path is to stage the schema change. First, add the new column without a default or constraints. This is fast because it updates only metadata. Then backfill data in batches, using queries that respect your system’s load. Finally, add the default and constraints once the column is fully populated.
For systems with massive tables or tight SLAs, online schema change tools like pg_online_schema_change or gh-ost keep the process safe. They create a shadow table with the new column, copy data incrementally, and swap tables without blocking traffic.