[英]Reasons to have a Database per application
We are defining an architecture for a coupe of connected applications, and we are discussing why should we have or not have a shared database many applications can access.我们正在为一系列连接的应用程序定义架构,并且我们正在讨论为什么我们应该拥有或不拥有许多应用程序可以访问的共享数据库。 I would like to ask what are the benefits/disadvantages of having a shared database vs having a database per application?
我想问一下拥有一个共享数据库与每个应用程序拥有一个数据库的好处/坏处是什么?
As per the definition of mircoservices each service should be independent.根据微服务的定义,每个服务都应该是独立的。 You may save ressources by using a single database, but it destroys the benefits of dynamic scaling or availability.
您可以通过使用单个数据库来节省资源,但它会破坏动态扩展或可用性的好处。 By using a single database you create a single-point-of-failure which is an anti-pattern in the microservice world.
通过使用单个数据库,您可以创建单点故障,这是微服务世界中的反模式。
Another reason for using seperate databases might be for optimization.使用单独数据库的另一个原因可能是优化。 One service might require a relational database, but another one stores for example analytical data where a time-series database is a better fit.
一项服务可能需要一个关系数据库,但另一项服务存储例如分析数据,其中时间序列数据库更适合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.