Skip to content

Multi-Tenancy

Multi-Tenancy

Build SaaS applications with built-in tenant isolation, quotas, and change data capture.

Tenant Management

Create Tenant

Terminal window
\tenant create acme_corp enterprise schema

List Tenants

Terminal window
\tenants

Switch Tenant Context

Terminal window
\tenant use acme_corp

Isolation Levels

LevelDescription
sharedLogical isolation via tenant_id column
schemaPer-tenant schema isolation
databaseFull database isolation

Quotas

Set Quotas

Terminal window
\tenant quota set acme storage=10GB connections=50 qps=1000

View Usage

Terminal window
\tenant usage acme

Plans

Terminal window
\tenant plans # List plans
\tenant plan create pro tier=2 storage=50GB
\tenant plan acme_corp pro # Assign plan

Change Data Capture (CDC)

Terminal window
\tenant cdc # View recent events
\tenant cdc export events.json # Export to file

API Endpoints

GET /v1/tenants
POST /v1/tenants
GET /v1/tenants/{id}/usage
POST /v1/tenants/context