Sébastien Rigaux

Tech watch

← All links

SQL Server

Microsoft’s relational engine for SQL queries, schemas and data processing.

Graphic titled “Multi-Tenant .NET, Part 2 — Shared Database with Schema Separation,” showing a “House for Rent” sign, a circular emblem with two swords, and an illustrated portrait.

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.

BarretFound via C# Digest

Banner over a photograph of apartment buildings, titled “Multi-Tenant .NET, Part 1 — Shared Database with Partitions,” with a crossed-swords emblem and an illustrated portrait.

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.

BarretFound via C# Digest

Visual overview of sqlsimtools with Studio, CLI, Python, and AI agent

sqlsimtools provides an open-source toolkit to test, replay, and compare SQL Server workloads without any hosted service or external telemetry. It offers four modes: a local Studio UI, a native CLI, a Python workflow, and an AI agent-driven experiment builder. The same suite applies to SQL Server 2019–2025, Azure SQL, and Microsoft Fabric, on Windows or Ubuntu, with local installation and direct execution against your chosen target.

Microsoft