Tenancy
Tenancy isolates each Customer in its own Tenant inside a Startup namespace, from records and keys to Limits.
Tenancy gives each Customer of a Startup its own Tenant: a partition of records, keys, Settings and Limits no other Customer reaches.
Contract
- A Startup is a namespace at
api.sb/. A Tenant adds one path segment,<domain> api.sb/, or takes its own host.<domain>/ <tenant> - A Tenant's data belongs to the Customer it was made for. The Startup operates it.
- A Tenant's keys reach only that Tenant. No query crosses Tenants, whatever its filter.
- Settings inherit from Studio to Startup to Tenant, nearest holder first. A locked Setting overrides every descendant, and a child may tighten a value but never loosen it.
- Limits apply per Tenant, so one Customer's traffic never spends another's capacity.
Tenant.provisioncreates a Tenant with its keys, defaults and an admin invitation in one Action.- An Agent sold to Customers runs a Worker in each Customer's Tenant, with that Tenant's Memory only.
- A Tenant is private by default. It can open reads to any key holder, or to the public.
Verbs
Interfaces
Example
// shiftly.app schedules restaurant staff. Each restaurant group is one Tenant.
import { $ } from 'startup-builder'
const tenant = await $.Tenant.provision({
customer: 'customer_harbor_group',
})
// tenant.$id: https: //api.sb/ shiftly.app/ harbor-group