# Multi-tenancy · Tech watch

[Canonical source](<https://sebastien.rigaux.be/en/tech-watch/tags/multi-tenancy>)

Architecture allowing multiple tenants to share an application while isolating their data.

Related tags : [Entity Framework Core](<https://sebastien.rigaux.be/en/tech-watch/tags/entity-framework-core>) · [SQL Server](<https://sebastien.rigaux.be/en/tech-watch/tags/sql-server>)

## [Finbuckle.MultiTenant: isolate tenants in a .NET application](<https://sebastien.rigaux.be/en/tech-watch/links/finbucklemultitenant-isolate-tenants-in-a-net-application>)

Finbuckle.MultiTenant provides ASP.NET Core with tenant resolution, per-tenant configuration, and data-isolation building blocks. A basic setup combines a host-based strategy, a configuration-backed store, and the `UseMultiTenant()` middleware.

The middleware must run before components that depend on the tenant, such as authentication and authorization. The library also includes integrations for per-tenant options, authentication, and Entity Framework Core data isolation.

2026-11-02 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/finbucklemultitenant-isolate-tenants-in-a-net-application.md>) · [Original resource](<https://www.finbuckle.com/MultiTenant/#getting-started>)

## [.NET multi-tenancy: move a tenant without downtime — part 4/4](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-move-a-tenant-without-downtime-part-44>)

This installment explains how to move a tenant from a shared database to a dedicated one without taking the application offline or disrupting other tenants. The catalog drives the switch, while the same EF Core model and query filter serve both isolation modes.

The migration uses an initial copy, a temporary read-only window, a delta copy, and verification before cutover. The runbook waits for the cache to expire before reopening writes, preventing instances that still hold the old connection from writing to the shared database after the switch.

2026-11-02 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-move-a-tenant-without-downtime-part-44.md>) · [Original resource](<https://barretblake.dev/posts/development/2026/08/multi-tenant-moving-day/>)

## [.NET multi-tenancy: one database per tenant — Part 3/4](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-one-database-per-tenant-part-34>)

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.

2026-11-02 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-one-database-per-tenant-part-34.md>) · [Original resource](<https://barretblake.dev/posts/development/2026/08/multi-tenant-part-3/>)

## [.NET multi-tenancy: isolate data by SQL Server schema — part 2/4](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-isolate-data-by-sql-server-schema-part-24>)

Part 2/4 shows how to isolate each tenant’s data in its own SQL Server schema, without a global query filter or a required `TenantId` column. EF Core can use a simple primary key again, while the database structure itself enforces the isolation boundary.

The key change is model caching: `OnModelCreating` runs only once per model. The schema must be included in the cache key through `IModelCacheKeyFactory`, or EF Core may reuse the first tenant’s schema. The article also covers per-schema provisioning and migrations, plus strict validation of schema names interpolated into SQL.

2026-11-02 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-isolate-data-by-sql-server-schema-part-24.md>) · [Original resource](<https://barretblake.dev/posts/development/2026/07/multi-tenant-part-2/>)

## [.NET multi-tenancy: query isolation and SQL Server partitions — part 1/4](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-query-isolation-and-sql-server-partitions-part-14>)

This first installment presents a shared-schema .NET multi-tenant design: EF Core filters reads by tenant, while SQL Server physically partitions rows to speed up data access. The key distinction is that partitioning is not a security boundary; isolation relies on the EF Core global query filter.

The article also explains resolving the tenant per request, assigning its ID to new rows, and adding partitions to migrations with raw SQL. The primary key must include `GuildId`, a constraint SQL Server imposes when partitioning a unique index.

2026-11-02 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-query-isolation-and-sql-server-partitions-part-14.md>) · [Original resource](<https://barretblake.dev/posts/development/2026/07/multi-tenant-part-1/>)

## [A Next.js SaaS starter with authentication and multi-tenancy](<https://sebastien.rigaux.be/en/tech-watch/links/a-next-js-saas-starter-with-authentication-and-multi-tenancy>)

This boilerplate combines Next.js, Tailwind and shadcn/ui with authentication, roles and team support. Database, internationalization and testing foundations help bootstrap a SaaS application.

2025-07-19 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/a-next-js-saas-starter-with-authentication-and-multi-tenancy.md>) · [Original resource](<https://github.com/ixartz/SaaS-Boilerplate>)

## [Structure a multi-tenant application with FinBuckle](<https://sebastien.rigaux.be/en/tech-watch/links/structure-a-multi-tenant-application-with-finbuckle>)

The article explains how FinBuckle.MultiTenant fits into ASP.NET Core through tenants, resolution strategies and stores. It provides a foundation for tenant isolation and tenant-specific behavior.

2023-09-10 · [Markdown](<https://sebastien.rigaux.be/en/tech-watch/links/structure-a-multi-tenant-application-with-finbuckle.md>) · [Original resource](<https://khalidabuhakmeh.com/posts/multi-tenancy-with-aspnet-core-and-finbuckle-multitenant/>)
