问题描述
我的应用程序包含许多微服务,每个微服务都有自己的数据库。有时,作为升级服务的一部分,可能需要对数据库进行更改,例如列名可能会更改或数据可能合并。
执行滚动升级时数据库更改将执行的应用程序,但如果服务有问题并且应用程序回滚到先前版本,则对DB的更改将已执行并可能导致
问题。
所以我想知道其他人如何管理这种情况?我显然可以在需要时进行数据库备份并恢复,但是有更好的方法吗?理想情况下,我希望能够执行滚动升级,而不必在db更新事件中将系统降低到
?
任何帮助都会很棒。
谢谢。
Hi,
I have an application that contains a number of Microservices, each Microservice has it's own DB. Occasionally as part of a upgrade to a service, a change maybe needed to the DB, for example maybe a column name might change or data may be merged.
When performing a rolling upgrade of the application the database change would carried out, but if the service had a issue and the application rolled back to the previous version the change to the DB would have already been carried out and potentially cause issues.
So i'm wondering how other people manage this scenario? I can obviously take DB backups and restore back if needed, but is there a better way to be doing this? Ideally i want to be able to perform rolling upgrades and not have to bring the systems down in the event of a db update?
Any help would be great.
Thanks.
这篇关于MicroService与数据库滚动升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!