One database per tenant, the platform directory that finds it, and the customer model above it.
Every tenant gets its own Neon project: a Postgres database with an identical schema, a Neon Auth instance with its own signing keys, and object-storage buckets. The project is the isolation boundary. A database branch forks the files with it, a suspended project takes its whole surface dark, and deleting a tenant is deleting one project.
No table carries a tenant id. A query runs against one tenant's connection and can see only that tenant's rows, so isolation does not depend on a filter being remembered.
Users do not cross tenants either. The same email signing in at two stores creates two accounts, one in each store's auth schema. There is no single sign-on and no tenant switcher.
One small shared database holds the directory. Its public schema is the customer model; a sealed fleet schema maps a slug to the tenant's database, Data API and auth endpoints.
| Concept | Is |
|---|---|
| Organization | The account: team membership and billing. |
| Project | A store. One project is one tenant database. |
| Deployment | A Vercel deployment serving one surface of a project: the back office, the storefront, or the tenant's own pages. |
A project is a database. There is no staging sub-entity; a staging copy is a separate project the customer creates.
A project moves through provisioning, active, suspended, failed and deprovisioning. Only active resolves to a serving store. A gate can still read the status of a dark store, so the page can say why it is unavailable without being a way to reach it.
The web runtime reads the directory through a role that can select a tenant's endpoints and nothing else. The tenant's own database URL carries no password: the runtime attaches the signed-in user's token and the database verifies it. Administrative credentials are never stored; operations derive them on demand from Neon, which is the source of truth.
| Boundary | What protects it |
|---|---|
| Tenant data isolation | A separate Neon project per tenant. |
| Per-user data within a tenant | Row-level security keyed on the verified session. |
| The pre-auth surface | No tenant database queries; static assets and public reads only. |
| Admin credentials at rest | Not stored. |
| Storage across tenants | The per-tenant project boundary, plus a server-side key prefix. |
| Platform database writes | Operations only; the runtime holds a read-only role. |