-
Notifications
You must be signed in to change notification settings - Fork 163
Managing sharding databases
Since AuthP version 6 when you set the AuthPermissionsOptions's TenantType and added SetupMultiTenantSharding method to register that the multi-tenant is using sharding, then to make sharding to work the app needs to holds information to link a tenant to a database - known as sharding entries. How this works can be found in How AuthP handles sharding but this document covers how you can use the IGetSetShardingEntries to read / change the sharding entries.
The typical things you might to do are:
- Managing sharding entries
- Reading the connection string names
The GetAllShardingEntries method reads the information in the sharding entries. This is used internally but is also useful for the admin user to see what the sharding entries. The screenshot below comes from Example6.MvcWebApp.Sharding web application. If you log in as an application admin user and click the Auth Admin -> List database info.

The code for these can be found in the ShardingController class of Example6 and Example7
These are simple to understand. They alter the sharding entries containing all the sharding entries.
-
AddNewShardingEntry(info)- Adds a new sharding entry to the sharding entries. -
UpdateShardingEntry(info)- Updates the sharding entry with the givenName. -
RemoveShardingEntry(name)- Removes the sharding entry with the givenName.
???????????????????????????????????????????????????????????
- 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