The query started timing out, and no one knew why. Then someone noticed the schema change: a new column had been added.
Adding a new column in a live database can look trivial. It is not. Whether you use MySQL, PostgreSQL, or a managed cloud service, the risk is real. Poorly planned changes can lock tables, block writes, and stall deployments. In high-traffic systems, even a few seconds of downtime can cascade into failures across services.
The process begins with design. Define the new column in a way that matches current and future data use. Choose the smallest data type that fits the need. Avoid null defaults unless intentional. Every extra byte per row consumes storage and memory in caches.
Migration planning is next. On small tables, an ALTER TABLE ADD COLUMN may finish instantly. On large production tables, this can be a blocking operation. Tools like pt-online-schema-change or native online DDL methods in PostgreSQL and MySQL can prevent locks. Test these operations in a staging environment with realistic data volume before touching production.