2 deploys isn't enough for robustness. It depends on what the change is, but the full sequence is often more like
* Add the new schema
* Write to both the new and old schemas, keep reading from the old one (can be combined with the previous step if you're using something like Flyway)
* Backfill the new schema; if there are conflicts, prefer the data from the old schema
* Keep writing to both schemas, but switch to reading from the new one (can often be combined with the previous step)
* Stop writing to the old schema
* Remove the old schema
Leave out any one of those steps and you can hit situations where it's possible to lose data that's written while the new code is rolling out. Though again, it depends on the change; if you're, say, dropping a column that no client ever reads or writes, obviously it gets simpler.
Yup, it depends on the change. Sometimes two deploys is enough — e.g. making a non-nullable column nullable — and sometimes you need a more involved process (e.g. backfilling).
Nonetheless, I agree with the OP that the article's advice is pretty bad. If you ensure that multiple apps/services aren't sharing the same DB tables, refactoring your schema to better support business needs or reduce tech debt is
a. tractable, and
b. good.
The rules from the article make sense if you have a bunch of different apps and services sharing a database + schema, especially if the apps/services are maintained by different teams. But... you really just shouldn't put yourself in that situation in the first place. Share data via APIs, not by direct access to the same tables.
Why wouldn't one deploy be enough to convert a non-nullable column to nullable? Going the other way takes two deploys I can see, but this way seems like is entirely backwards compatible.
If apps are using the column they might need code changes to handle the column suddenly having nulls. So you would have to change and redeploy the code, then make the column nullable.
* Add the new schema
* Write to both the new and old schemas, keep reading from the old one (can be combined with the previous step if you're using something like Flyway)
* Backfill the new schema; if there are conflicts, prefer the data from the old schema
* Keep writing to both schemas, but switch to reading from the new one (can often be combined with the previous step)
* Stop writing to the old schema
* Remove the old schema
Leave out any one of those steps and you can hit situations where it's possible to lose data that's written while the new code is rolling out. Though again, it depends on the change; if you're, say, dropping a column that no client ever reads or writes, obviously it gets simpler.