简体   繁体   English

每个应用程序都有一个数据库的原因

[英]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.

相关问题 有一个没有 integer 主键的数据库表有什么好的理由吗? - Are there any good reasons to have a database table without an integer primary key? 每个租户具有微服务和数据库的 SAAS 应用程序 - SAAS application with microservices and database per tenant 不使用关系数据库的好理由? - Good reasons NOT to use a relational database? 不使用数据库连接池的原因? - Reasons not to use database connection pooling? 简单的MySQL数据库问题-每个应用程序用户的数据库? - Simple MySQL database questions - Database per user of application? 具有数据库数据的内存副本的框架/应用程序 - Framework/application to have inmemory copy of DataBase data 如何在每个数据库具有不同架构的每个租户应用程序中处理具有数据库的多租户 - How to handle a multi tenant with database per tenant application where each database has a different schema 如何在Eclipse DTP中为每个数据库连接设置多个模式? - How do I have multiple schemas per database connection in Eclipse DTP? 什么时候每个多个数据库连接有一个事务是有意义的? - When does it make sense to have a single transaction per multiple database connections? 您是否有任何原因可能不想在关联中拥有foreign_key? - Are there any reasons you might not want to have a foreign_key in an association?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM