多个应用使用一个数据库? [英] Multiple application using one database?
问题描述
Think Design:我有很多应用程序共享同一个用户数据库!其他表也共享,如用户活动日志,购买等
Think Design: I have many applications that share the same user database! Other tables are shared as well such as user activity logs, purchases etc
1)无论如何我的问题是,如果我是使所有的应用程序只使用1数据库的一切!我有可扩展性的任何问题吗?还是任何其他问题这样做?是否最好有1个数据库? ?或最坏?
1) Anyways my question is if I was to make all applications just use 1 database for everything! Would I have any problems with scalability? Or any other problem doing this? Is it better to have 1 database ? ? Or worst?
2)或者我应该让每个应用程序都有自己的数据库,然后使用Web服务共享应用程序之间的公共表?
2) Or should I just let every application have their own database, then use web service to share the common tables between the applications?
推荐答案
访问共享资源的进程越多,扩展/性能和计时问题的可能性就越大。
The more processes you have accessing a shared resource, the more likely you are to get into scaling/performance and timing issues.
即使你的应用程序很小,我建议不要这样。
Even if your applications are small, I would recommend against this.
这个整个企业的最糟糕的部分可能是您将添加到您的应用程序集中的不必要的复杂性。毕竟,编程不是线性的,只需添加一个表格即可进行交互,从而使整体复杂性增加一倍以上。
Probably the worst part of this whole venture would be the unnecessary complexity you will be adding to your application set. After all, programming is not linear, and simply adding a single table to interact with increases your overall complexity by more than a factor of one.
至少,创建用于与常用表格进行交互的服务,并让您的应用程序通过服务提出请求。
At the very least, create a service for interacting with commonly used tables and have your applications make requests through the service.
我希望将资源合并到一个共同的位置,但我认为这种情况下,你将为自己设置更多的困难下线。
I empathize with your desire to merge resources into a common location, but I think in this case you will be setting yourself up for more hardships down the line. I just don't think it's worth it.
响应您的编辑...我会选择选项(2)。
In response to your edits... I'd go with option (2).
这篇关于多个应用使用一个数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!