每个客户端一个数据库或一个数据库中的所有客户端。我应该使用哪一个在线申请? [英] one database per client or all clients in one database. which one should I use for a online application?

查看:116
本文介绍了每个客户端一个数据库或一个数据库中的所有客户端。我应该使用哪一个在线申请?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这个应用程序将有多个模块,从项目管理到会计模块。
问题是我每个客户端(公司)还是一个数据库都有一个数据库,其中包含所有内容?



1)哪个更好的性能明智? br>
2)将要管理多个数据库或更难管理这些可管理性。

3)我们将为所有用户提供相同的应用程序,这意味着相同无论数据库数量如何,都将使用模式。

4)一些客户端将会有很多(例如,会计师在一个表中每年可以增加200万行)而其他人则会使用更少的数据。



你认为我应该使用什么?

解决方案

1)具有单独的数据库允许在多个主机上更容易地分配负载,它以许多方式提升屋顶;磁盘,内存,锁定,cpu,备份时间等。如果您认真地将数百万行放在mysql中,那么单独的数据库(不仅仅是模式),甚至是单独的实例当然是一个好主意,因此消耗资源的客户不会在更少的资源消耗方面施加停机时间。



2)管理N数据库的数量将更为困难N倍:o)这个额外的费用必须与使用just的成本进行比较一个数据库/模式,而是管理代码中客户的分离。如果您必须在托管公司或甚至本地的恶劣的dba呼叫客户支持,而不是每次需要更新模式或创建新的数据库时,只需从控制台运行整洁的脚本,这本身就难以管理。 / p>

有些数据库和持久化框架支持多租户,Oracle有这样的支持开始在Hibernate 4中出现。



即使许多参数指向单独的数据库的方向,它通常也可以仅使用一个数据库。


So I have this application that would have multiple modules, from project management to accounting modules. The question is should I have one database per client (company) or one database that holds everything ?

1) which one would be better performance wise?
2) is is going to be a lot harder to manage multiple databases or is these manageable.
3) We are going to have the same application for all users, meaning that the same schema is going to be used no matter the number of databases.
4) some clients are going to have a lot of that (accountants for example might have up to 2 million row added per year in one table) while others are going to use much much fewer data.

what do you think I should use?

解决方案

1) Having separate databases allows for easier distribution of load on several hosts, it lifts the roof in many ways; disk, memory, locking, cpu, backup-time and so on. If you are serious about putting millions of rows in mysql, it is certainly a good idea with separate databases (not only schemas), and even separate instances, so that the resource-consuming customers won't impose downtime on less resource consuming ones.

2) It is going to be exactly N times harder to manage where N is the number of databases :o) This extra cost you must compare to the cost of using just one db/schema and instead manage separation of customer in code. It's also inherently much harder to manage if you have to call customer support at your hosting company, or even your local grumpy dba, instead of just running a neat script from your console each time you need to update schema or create a new database.

Some databases and persistence frameworks have support for multi-tenancy, Oracle has this and support is beginning to emerge in Hibernate 4.

Even though many arguments point in the direction of separate databases, it is generally possible to use just one database as well.

这篇关于每个客户端一个数据库或一个数据库中的所有客户端。我应该使用哪一个在线申请?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆