Blog Logo

Backward Compatible Database Changes

Learn about safely using the contract, migrate, and expand pattern to make database schema changes without downtime and data loss. By deploying changes to two critical systems at once, such as your database and application, you double the risk of something going wrong. Its impossible for application code and database schema changes to deploy together atomically. If they are ever dependent on each other going out simultaneously, the application will error briefly until the other catches up. This blog post will answer this question and break down the steps you need to follow to ensure you are safely making changes to your database and ensuring no downtime or disruptions for your users. Different types of database schema changes include adding a table or view, adding a column, changing an existing column, table, or view, and removing an existing column, table, or view. The expand, migrate, and contract pattern should be used for any operation that touches schema your production application is already using.