-
Notifications
You must be signed in to change notification settings - Fork 163
Sharding: Move Tenant to database
Jon P Smith edited this page Aug 23, 2022
·
3 revisions
There is only one extra Tenant Admin command when you are using many-databases structure (e.g. when the TenantType property in the AuthP options has the AddSharding member added) is the MoveToDifferentDatabaseAsync. This method does two things:
- It can move the tenant's data to another database, defined by the connection string names.
- It can change the tenant's
HasOwnDbproperty, which will change whether the tenant has its own database or not. Note the you can just changed theHasOwnDbproperty, then it changes the database arrangement.
See Moving a hierarchical Tenant for a useful diagram showing what happens in a hierarchical tenant move.
The method is easy to use, but be aware implementing the code your tenant change service is quite difficult. See the MoveToDifferentDatabaseAsync implementation in the ShardingTenantChangeService
- Intro to multi-tenants (ASP.NET video)
- Articles in date order:
- 0. Improved Roles/Permissions
- 1. Setting up the database
- 2. Admin: adding users and tenants
- 3. Versioning your app
- 4. Hierarchical multi-tenant
- 5. Advanced technique with claims
- 6. Sharding multi-tenant setup
- 7. Three ways to add new users
- 8. The design of the sharding data
- 9. Down for maintenance article
- 10: Three ways to refresh claims
- 11. Features of Multilingual service
- 12. Custom databases - Part1
- Videos (old)
- Authentication explained
- Permissions explained
- Roles explained
- AuthUser explained
- Multi tenant explained
- Sharding explained
- How AuthP handles sharding
- How AuthP handles errors
- Languages & cultures explained
- JWT Token refresh explained
- Setup Permissions
- Setup Authentication
- Startup code
- Setup the custom database feature
- JWT Token configuration
- Multi tenant configuration
- Using Permissions
- Using JWT Tokens
- Creating a multi-tenant app
- Supporting multiple languages
- Unit Test your AuthP app