Adding a new column sounds simple. In production, it can be anything but. Schema changes can lock writes, stall deployments, and risk outages if done wrong. To get it right, you must plan the migration as carefully as you design the feature.
First, define the new column with absolute precision. Decide on data type, nullability, default values, and indexing strategy before you touch the database. In relational systems, these decisions impact performance and future maintainability. Avoid unnecessary indexes until you measure real query patterns.
Next, choose a migration approach that minimizes risk. For large datasets, an online schema migration tool can add a new column without locking the table. Tools like pt-online-schema-change or native features in PostgreSQL and MySQL can handle this. In some cases, creating the new column in a shadow table and swapping references may be safer.