Multi-Tenancy
Build SaaS applications with built-in tenant isolation, quotas, and change data capture.
Tenant Management
Create Tenant
\tenant create acme_corp enterprise schemaList Tenants
\tenantsSwitch Tenant Context
\tenant use acme_corpIsolation 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 <tenant> <storage_mb> <connections> <qps>\tenant quota set acme_corp 10240 50 1000View Usage
\tenant usage acme_corpPlans
\tenant plans # List plans\tenant plan create pro 2 51200 50 1000 # <name> <tier> <storage_mb> <conn> <qps>\tenant plan acme_corp pro # Assign planChange Data Capture (CDC)
\tenant cdc # View recent events\tenant cdc export events.json # Export to fileWhere Tenants Are Managed
Manage tenants, plans and quotas from the REPL (above) or the embedded Rust API; a REST API for tenant management is planned. Tenants, plans and policies live in the memory of the process that defines them and are not persisted across restarts.
In the stock Nano server, row-level security is enforced through the embedded API and the
REPL; SQL CREATE POLICY and enforcement for REST and wire clients are planned.
Related
- Row-Level Security - Policy-based access control
- REST API Reference - HTTP routes in the current release