The table locks. The query runs long. You realize you need a new column.
Adding a new column in a live system is more than a schema change. It can affect read performance, write throughput, and deployment safety. Whether you use PostgreSQL, MySQL, or a cloud-native database, the principles remain: plan, execute, and verify.
First, define the column with precision: correct data type, nullability, default value. Avoid adding heavy defaults that rewrite the entire table, as that can trigger full table locks and downtime. In PostgreSQL, adding a new nullable column with no default is instant. In MySQL, older versions require a full table copy; newer ones with ALGORITHM=INPLACE or INSTANT can skip that. Check your engine version before running migrations.
Next, coordinate schema migration with application code. If the new column will be populated later, release the schema before code that writes to it. For columns that must be read immediately, seed them in background jobs before rolling out dependent features. Use feature flags to control rollout without risking broken reads.