Updating your database development
Let’s take a closer look at the backward-compatible operations first.Backward-compatible operations are all operations that change your database in a way that it can be used by the old and the new version of your application.You can easily fix that by providing a default value; please check your database documentation on how to do that.If you don’t want to define a default value, you need to execute 3 statements to add the column with the constraint: The good news is that you can execute all 3 statements within the same migration step.
No application is using that column anymore so there is also no application that could be affected by its removal.
You no longer need to just adapt the database in the way it’s required by your application; you also need to do it in a way that the old and the new version of your application can work with the database.
That means that all migrations need to be backward-compatible as long as you’re running at least one instance of the old version of your application.
But the idea is always the same: You have a bunch of instances of a subsystem and you shutdown, update, and restart one instance after the other.
While doing that, you run the old and the new version of your application in parallel.
The two most important ones are: But they also create new challenges.