One pool per tenant
TenantRegistry + ConnectionCache manages isolated connection pools automatically. LRU eviction and idle-timeout keep memory bounded.
TenantRegistry + ConnectionCache manages isolated connection pools automatically. LRU eviction and idle-timeout keep memory bounded.
AsyncLocalStorage propagates the current tenant's connection and models through your entire request stack. Call useTenant() anywhere.
Resolve the tenant from a subdomain, HTTP header, URL path segment, JWT claim, or any custom function you provide.
The core is ORM-agnostic. Official adapters for Sequelize, Prisma, and Drizzle. Bring your own by implementing the Adapter interface.
Thin middleware adapters for Express, Fastify, Koa, and NestJS. Wires resolution and context into your framework with two lines.
@kosan/cli iterates all active tenants and runs Umzug migrations against each in parallel, with failure isolation and concurrency control.