Giter VIP home page Giter VIP logo

Comments (4)

pradeepgururani avatar pradeepgururani commented on July 2, 2024

Have tried setting options.TenantType = TenantTypes.HierarchicalTenant | TenantTypes.AddSharding; as well. With Hierarchical + Sharding we are able to create only top level and no child level.

Is Hierarchical tenancy and sharding mutually exclusive?

from authpermissions.aspnetcore.

JonPSmith avatar JonPSmith commented on July 2, 2024

Hi @pradeepgururani,

OK, you are trying to create a hierarchical multi-tenant in one database, which is fine (Example4 does this). The problem is you need to use the IAuthTenantAdminService service. The IShardingOnlyTenantAddRemove service is only for a sharding-only tenants.

from authpermissions.aspnetcore.

pradeepgururani avatar pradeepgururani commented on July 2, 2024

But we don't want only hierarchical multi-tenant. We want it with sharding support. We are fine with the premise that top level tenant alone will have own DBs and child level tenant will reside with their parent tenant db. In our case this is not working while using IAuthTenantAdminService.AddHierarchicalTenantAsync.

The hasOwnDb parameter is true, but the sharding database name 'SignOn-20240120163734-870' already has tenant(s) using that database.

In your examples we couldn't find any example with hierarchical + sharding combination. We could use help from your side.

from authpermissions.aspnetcore.

JonPSmith avatar JonPSmith commented on July 2, 2024

I think you haven't understand the different services used for the two sharding approaches: hybrid and sharding-only sharding.

You have selected the hybrid approach so you should use the IAuthTenantAdminService service. The IShardingOnlyTenantAddRemove is only for the sharding-only type, so if you give it a tenant that shares a database then it will give you an error.

I recommend you read the article called The (long) journey to a better sharding multi-tenant application which explains that hybrid type has to have manually manages because a tenant's data might be in a database shared by other tenants, or it could have its own database. What I did find that the sharding-only type has only one way to work, so I created the IShardingOnlyTenantAddRemove service to make it easier for the developer and admin user.

PS. If you are using Sign up for a new tenant, with versioning with the hybrid type, then you need to create a ISignUpGetShardingEntry that can handle many tenants sharing one database AND tenants that have their own database. The Sign Up documentation has a section on the ISignUpGetShardingEntry with examples

from authpermissions.aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.