http://ayende.com/Blog/archive/2008/08/07/Multi-Tenancy--The-Physical-Data-Model.aspx
Continuing on the multi tenancy theme, let us talk about the actual physical structure of the data store. In general, you have two basic options.
The TenantId column and separated data stores. The TenantId is simply adding a column to all the columns, showing what tenant the row belongs to.
The separate data store calls for a much higher level of separation, where there is no shared storage for the tenants.
There are variation on those, such as having separation in the schema level instead of DB level, etc, but they all end up being down to one of those choices.
The TenantId approach allows you to use a single DB for the entire application, potentially reducing costs for managing the environment. It is also the easiest to explain, we just filter by TenantId and that is it!
It comes with a whole set of problems that is related to that decision, however:
Isolation - You have to actively do filtering all the time. This has major issues on your code. And now, tacking TenantId = @CurrentTenant at each query is not going to be sufficient. Consider the case of joins in such an environment, you are likely to get a filter only on the end result, after it was joined already. And that is just one example.
Backup - The backup strategy that you have for this scenario sucks. Basically, you have to roll your own.
Customer copy of the data - Going back to the backup strategy? You can't just hand the customer the backup. You have to dump the data out, and write something that writes it back in, and it has to be fast.
Security - you have to let all tenants access the data, security is in the app logic level.
Extensibility - in a shared environment it is hard to do a lot of extensibility in the data, because each client is stepping on each other toes.
As you probably gathered, I strongly suggest going with the separate model. Now our management strategy is dealing with the connection string. Isolation is built in and doesn't require any , for backup you have the vendor tools, and giving the customer its own data is trivial, just send him the backup file. Security is easy, a tenant can access only their DB, and extending this is much easier, because each tenant has their own walled garden to play with.
分享到:
相关推荐
【标题】"multi-tenancy-assets-master.rar" 暗示了一个关于多租户资产管理系统的源代码库。多租户架构是一种设计模式,常见于云计算服务,它允许单个软件实例服务于多个独立的客户,每个客户称为一个租户。在这样的...
本项目"multi-tenancy-test"专注于多租户测试,使用了Java生态系统中的Hibernate 4 ORM框架和JavaServer Faces(JSF)2 Web应用框架。 **多租户概念** 多租户架构的核心是数据隔离,每个租户都有自己的数据视图,而...
【鼎甲备份软件多租户管理配置手册】是广州鼎甲计算机科技有限公司为用户提供的一款详尽的指导文档,旨在帮助用户理解和配置其备份系统的多租户功能。在现代云计算环境中,多租户架构已经成为一种常见的方式,允许...
标题"acm-multi-tenancy-dev-team测试"暗示了这是一个关于ACM(可能是Application Configuration Manager或Automated Certificate Management)系统中多租户开发团队的测试项目。团队可能正在对支持多租户特性的代码...
36 为什么说Kubernetes只有soft multi-tenancy?.pdf
资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:django_tenancy-0.3.1a2-py2.py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
这是一个示例应用程序,显示了如何实现多租户架构。 要求:您应该已经安装并配置了maven您应该已经安装了MySQL并为MySQL设置了环境变量(无论您的命令行/终端目录如何,都可以在计算机中执行命令“ mysql”)。...
资源分类:Python库 所属语言:Python 资源全名:django_tenancy-0.2.2-py2.py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
"jhipster-multi-tenancy-poc" 是一个针对 JHipster 平台的多租户概念验证(Proof of Concept,PoC)项目,旨在展示如何在 JHipster 应用中实现多租户功能。 在企业级软件开发中,多租户架构是一种重要的设计模式,...
lb4-多租户 该应用程序是使用和。 安装依赖项 默认情况下,生成此应用程序时会安装依赖项。 每当package.json中的依赖项发生更改时,请运行以下命令: npm install 要仅在package-lock.json安装已解决的依赖项,请...
这个“mybatis-plus-multi-tenancy_springboot多租户实现例子.zip”压缩包提供了一个使用SpringBoot和MyBatis Plus实现多租户系统的示例。以下是对这个项目的关键知识点的详细解释: 1. **多租户架构**:多租户是指...
**JPA多租户详解** Java Persistence API (JPA) 是Java平台上的一个标准,用于对象关系映射(ORM),...通过深入研究`jpa-multi-tenancy-master`项目,开发者可以获得宝贵的实践经验,更好地理解和应用JPA的多租户特性。
composer require laravel/sanctum ...// skopiowane z Stancl'owego InitializeTenancyByDomain ... if(in_array($request->getHost(), config('tenancy.central_domains'), true)){ return $next($requ
Cognos Cognos Cognos Cognos Cognos Cognos Cognos Cognos
docker build -t harbur/docker-multi-tenancy . 或搭配Docker Compose docker-compose build 入门 使用Docker运行代理: docker run -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock harbur/docker-...
**Laravel 开发中的多租户解决方案:laravel-tenancy** 在 Laravel 开发中,多租户架构是一种设计模式,允许单个应用程序为多个独立的客户或组织提供服务,每个客户都拥有自己的数据和配置。laravel-tenancy 是一个...
"multi-tenancy-master"可能是项目的根目录,其中包含了源代码、配置文件、测试文件等。开发者可以查看项目的`pom.xml`文件了解依赖管理,`src/main/java`下可能有Spring Boot的启动类和配置,`src/main/resources`...
composer require erikfig/laravel-tenancy 然后发布配置文件: php artisan vendor:publish --provider=ErikFig\Laravel\Tenancy\Providers\TenancyServiceProvider 将创建以下文件: 配置/ tenancy.php 路线/...