-
Notifications
You must be signed in to change notification settings - Fork 164
How AuthP handles sharding
This document tells you how the AuthP's sharding feature works internally, updated to AuthP version 6 and above. You don't need to read this to create a sharding multi-tenant application, but knowing how sharding works inside might help you build a better app.
Once you add the SetupMultiTenantSharding method to the registering of the AuthP, then you are some from of sharding multi-tenant application. At this point (irrespective of whether its hybrid or sharding-only) accessing a tenant's data is a lot more complex over the default "all tenants share one database" approach.
The "all tenants share one database" approach uses a connection string that provides all the informantion to access a database. But a sharding multi-tenant app needs to dynamically create a connection string to get the a) the correct database server, and b) the correct database on that database server. This creates the complete connection string combining the two parts:
- Get the database server from the appsettings file (See note about Azure overridding )
- Get the database name from the sharding entries.
- 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