The schema was perfect until the product team asked for one more metric. You check the table. No space for it. The solution is simple: create a new column.
Adding a new column sounds trivial, but in production systems it can break queries, overload migrations, and disrupt downstream pipelines. The change must be precise.
First, choose the right data type. Match it to the storage requirements and query patterns. Avoid defaults that bloat storage or slow indexing. For example, use INTEGER over BIGINT unless the range truly demands it.
Second, plan the migration. On large datasets, a blocking ALTER TABLE ADD COLUMN can lock the table and freeze transactions. In PostgreSQL and MySQL, adding a nullable column with no default is fast. Adding one with a default often triggers a full table rewrite.