简体   繁体   English

多租户架构

[英]Multi-tenant architecture

I've made an app that had every client on their own database. 我制作了一个使每个客户端都拥有自己数据库的应用程序。

It's now grown to the point that I'm thinking a better way for future updates of schema, would be the one-table multi-tenant type solution. 现在,我正在考虑一种更好的方式来将来更新架构,这将是单表多租户类型的解决方案。

What are the downsides to this? 这有什么缺点?

The one-table will basically be a table of leads, shared by multiple companies. 一张桌子基本上是由多家公司共享的潜在客户表。 At the current size, that's about 15,000,000 rows so far. 以当前的大小,到目前为止,大约有15,000,000行。 What are the implications of this table becoming too large, and how would I deal with it? 这张桌子过大意味着什么,我将如何处理?

Salesforce has a one-table Oracle database. Salesforce具有一个表的Oracle数据库。 Which must be massive!! 哪个一定很大! I'm just wondering how they deal with a constantly updating dataset, in terms of caches and locking, etc. 我只是想知道他们如何处理不断更新的数据集,例如缓存和锁定等。

Are you using any particular framework for your app? 您是否在为应用程序使用任何特定框架? Laravel has database migration ( http://laravel.com/docs/4.2/migrations ) functionality which allows you to update your database schema and roll it back programmatically, from the command line. Laravel具有数据库migrationhttp://laravel.com/docs/4.2/migrations )功能,通过该功能,您可以从命令行更新数据库架构并以编程方式回滚。 You can also use tools like Chef or Puppet to help you automate your databases via scripting, which can be version controlled. 您还可以使用ChefPuppet类的工具来帮助您通过脚本进行数据库自动化,脚本可以进行版本控制。

This way whenever you update a given client's installation, you're just running the version-controlled migration files which you can unit test on a local development server. 这样,只要您更新给定客户端的安装,就可以运行版本控制的迁移文件,您可以在本地开发服务器上对其进行单元测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM