单个数据库还是多个数据库?
我正计划实施一个提供 SaaS 的产品,在规划架构时,我们的团队遇到了是否为所有客户使用单一数据库或为每个客户使用单独的数据库?
谁能告诉我使用多个数据库的优点和缺点是什么? (性能、表缓存等)
I am planning to implement an product offering SaaS, while planning for architecture our team came across whether to use single database for all customers or using separate database for each customer?
Can anyone tell me what are pros and cons of using multiple database? (performance, table caching, etc..)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单个数据库的优点是您可以根据客户需求调整单个数据库。将高需求客户放在他们自己的机器上,将低需求捆绑在一台机器上,等等。
单个数据库的主要价值是拥有所有数据的单一视图,如果这对您很重要(统计数据、应用程序等) )。大多数数据库不提供指定表的“热”部分进行缓存等的选项,但您可以对单个表执行此操作。
我认为服务器内每个数据库的开销是最小的。如果您的客户不共享任何数据,那么单独的数据库可能是一个不错的计划。
The pros of individual DBs are that you can tune the individual DBs to customer needs. Put the high demand customers on their own machines, bundle low demand on a single machine, etc.
The primary value of a single db is having a single view of all of the data, if that's important to you (statistics, the application, whatever). Most DBs don't give you the option of specifying "hot" parts of a table for caching and whatever, but you can do that for individual tables.
The amount of overhead that each individual DB has within a server I think is minimal. If your clients are not sharing any data, then an individual DB may well be a good plan.