使用一个大型数据库或每个客户使用单个数据库 [英] Use one large database or use single databases per customer
问题描述
目前,我正在开发一种用于建筑材料的在线网络应用程序。公司可以登录我们的网站,然后他们可以使用webapp。
Currently I'm working on a on-line webapplication for construction materials. Companies can log in on our website and then they can use the webapp.
从一开始,想法是为每个客户创建一个数据库。但是现在它越来越大(100+),所以我们现在有100个数据库来管理。
From the beginnen the idea was to create a database per customer. But now it's becomming larger and larger (100+) so we have now 100 databases to manage.
我们必须运行约。每年两次更新db maintanance的更新脚本。
We have to run approx. twice a year an update script for db maintanance.
我看到的好处是,当客户想要退出时,我们删除他们的数据库,而不是完成。
The advantage that I see, is that when a customer wants to quit, we delete their database and than it's finished.
当我想添加新客户时,我需要填充数据库。 1.000.000特定客户的唯一记录,因为每个客户有不同的价格/材料。
When I want to add new customer, I have to fill the database with approx. 1.000.000 unique records for that specific customer, because every customer have different prices /materials.
对于备份,我使用MySQL Dump脚本,每天下载的数据库创建一个* .sql文件。
For backups I use a MySQL Dump script, that creates a *.sql file per database that I download every day.
你的看法是什么,你觉得怎么样?
一个大数据库或每个客户一个数据库?
What is your opnion and what do you think? One large db or per customer a database?
我使用MySQL与ASP.NET / C#...
I'm using MySQL with ASP.NET/C#...
推荐答案
我不想提出建议,因为有太多的变量。
I don't want to make a suggestion because there are far too many variables.
但我想说明的是,我的雇主有1000个部署的数据库 - 我们每个客户使用一个数据库进行复制(2+数据库)。
I do want to note, however, that my employer has 1000s of deployed databases -- we use one database per customer with replication (2+ databases).
所以,这个想法是可行的。我的工作与DB管理无关,但我记得我们在自动化和在线工具方面做了很多。备份和数据库管理由团队处理。
So, the idea is workable. My job isn't related to DB management but I do recall that we do a lot in the way of automation and online tools. Backups and DB management is handled by a team.
最终,您可以使100多个部署工作,但是您将要开始投资开发实用程序和工具来帮助自动化DB的备份和/或管理。
Ultimately, you can make the 100+ deployments work but you are going to want to start investing in the development of utility and tools to help automate the backup and/or management of the DBs.
理想情况下,没有什么(DB管理)应该手工完成。此外,连接字符串应当从给定的web应用部署抽象化。
Ideally, nothing (DB Management) should be done by hand. Furthermore, the connection strings should be abstracted away from a given web app deployment.
这篇关于使用一个大型数据库或每个客户使用单个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!