The database was failing because the schema could not keep up with the product. A feature needed data it could not store. The fix was clear: add a new column.
Adding a new column seems simple, but speed and precision matter. In production, schema changes can lock tables, trigger downtime, and slow critical queries. The process has to be deliberate—planned with both development and operations in mind.
First, define the exact type and constraints. A TEXT column without limits can become a performance cost. Index only when necessary. Each index has a write penalty, so understand the query patterns before making the change.
Second, choose a safe migration path. For massive datasets, an ALTER TABLE can stall for minutes or hours. Use online schema change tools or rolling deployments. In PostgreSQL, consider ADD COLUMN with a DEFAULT NULL and backfill later. In MySQL, use pt-online-schema-change or native online DDL when supported.