Sébastien Rigaux

.NET multi-tenancy: one database per tenant — Part 3/4

View resource

barretblake.dev

With one database per tenant, EF Core no longer needs a global query filter, a TenantId column, or a tenant-specific model cache key: the tenant is selected through a connection string resolved from a catalog database.

This isolation simplifies the model but shifts complexity to operations: each migration must be applied to every database. The article also explains how IDesignTimeDbContextFactory lets dotnet ef create the context without an active request or tenant.

A hand handles colorful network cables in front of rack-mounted equipment.