Hi
We would like to enquire if you have ever setup a 3 tier multi-tenancy environment.
Example would be where we as a service company control the host database, the tenant would be a company that contains multiple branches.
So the host, company and branch would be 3 seperate databases, or if chosen, the datbase structure would be host and company/branches would be one database.
Thanks
5 Answer(s)
-
0
If you really need seperate databases per branch, then why not just treat tiers 2 & 3 as seperate tenants?
-
0
Hi
Thanks for the speedy response.
Tier 2 should ideally manage and create Tier 3 Tenants, i.o.w Tier 3 should be connected to Tier 2 and Tier 2 should be connected to Tier 1.
-
0
Your use case is not supported out-of-the-box. The way to go is to program tier 2 and 3 as two specialised types of tenants, and setup permissions / roles accordingly. You can also explicitly code in behaviour for things like impersonation if you need it.
-
0
Hi,
We haven't done this before but it is possible. If you create your own implementation for https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Uow/IConnectionStringResolver.cs and use it on your app, you can determine the correct connection string for Host, Tenant or branch.
This one is used by default, https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.ZeroCore.EntityFrameworkCore/Zero/EntityFrameworkCore/DbPerTenantConnectionStringResolver.cs so your implementation will inject Branch into this logic.
-
0
Thanks so much for the suppot and suggestions, we will try it out!