Skip to content

Multi-Tenancy

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

Tenant Management

Create Tenant

\tenant create acme_corp enterprise schema

List Tenants

\tenants

Switch Tenant Context

\tenant use acme_corp

Isolation Levels

Level Description
shared Logical isolation via tenant_id column
schema Per-tenant schema isolation
database Full database isolation

Quotas

Set Quotas

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

View Usage

\tenant usage acme

Plans

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

Change Data Capture (CDC)

\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