Adding a new column in a production database is simple in theory, but the cost of getting it wrong is high. Locking tables, slowing queries, or losing data at scale can make a small change dangerous. To handle it right, you need a plan that works for both relational and distributed systems.
First, define the new column in a way that will not block writes. In PostgreSQL, adding a nullable column is fast because it updates metadata without rewriting rows. If you must have a default, avoid setting it inline during the migration—use a separate update step to backfill the data. In MySQL, adding columns to large tables can lock writes, so use ALGORITHM=INPLACE when possible.
Second, deploy the schema change before the code that writes to it. This keeps reads and writes stable while the column exists but remains unused. Once you confirm the column is in place, ship the application logic that starts populating it.