Base solution for your next web application
Open Closed

Multi-Tenancy: 3 Tiers #7224


User avatar
0
arnovz77 created

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

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

5 Answer(s)
  • User Avatar
    0
    mightyit created

    If you really need seperate databases per branch, then why not just treat tiers 2 & 3 as seperate tenants?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    arnovz77 created

    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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    mightyit created

    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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    arnovz77 created

    Thanks so much for the suppot and suggestions, we will try it out!

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)