The queries stall. You add indexes, tune joins, still not enough. The data has changed, and the schema must change with it. That’s when you add a new column.
Adding a new column sounds simple, but in production it can be dangerous. Locking tables, blocking writes, and breaking code are common. In high-traffic systems, schema migrations must be planned and executed with precision.
Before creating a new column, define its data type and constraints with care. Use NULL defaults only when necessary; prefer NOT NULL with sensible defaults to reduce surprises downstream. Document the column in your schema registry and commit changes through version control.
In relational databases like PostgreSQL or MySQL, an ALTER TABLE statement creates the new column. On small tables this is instant. On large tables, it may lock and rewrite data. For massive datasets, use tools like pg_online_schema_change, gh-ost, or native partitioning to avoid downtime.