Skip to content

How AuthP handles sharding

Jon P Smith edited this page Aug 11, 2023 · 6 revisions

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.

Overview of how

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:

  1. Get the database server from the appsettings file (See note about Azure overridding )
  2. Get the database name from the sharding entries.

Articles / Videos

Concepts

Setup

Usage

Admin

SupportCode

Clone this wiki locally