3 ms·
You can use any normal DB migration tool. For k8s, I put the app's readiness probe to false, run the migrations and then toggle the probe back to true. Here ar
by rkwz 6y ago
You can use any normal DB migration tool. For k8s, I put the app's readiness probe to false, run the migrations and then toggle the probe back to true.
Here are some migration libraries:
Go - https://github.com/golang-migrate/migrate https://github.com/golang-migrate/migrate
Node - https://github.com/salsita/node-pg-migrate https://github.com/salsita/node-pg-migrate
- slt2021 6y agoI wonder what happens during blue green or canary deployment? if your migration changes database schema in a way that affect previous version negatively? is it even possible to do blue/green deploy if your schema changes radically?
- rkwz 6y agoIt's definitely possible but we need to spend sometime to make sure the changes are backwards compatible and gradually rollout the destructive change. Here's a really good guide on how to do this - https://docs.gitlab.com/ee/development/avoiding_downtime_in_migrations.html https://docs.gitlab.com/ee/development/avoiding_downtime_in_...
- slt2021 6y agothank you very much! this is a treasure find for me
- Mavvie 6y agoIt's fine if you make the changes backwards compatible a version. And in general, any change can be done in a backwards compatible way (although it can be a PITA)