Templates / SaaS Multi-tenant
SaaS Multi-tenant Database Design (ERD Template)
A multi-tenant SaaS database design with a shared-schema approach: tenants own subscriptions, users join tenants through memberships (unique per tenant + user), and invoices hang off subscriptions. The membership join table is the heart of the model — one user can belong to many tenants with a different role in each.
Tables
| Table | Purpose |
|---|---|
tenants | Customer organizations (unique slug) |
users | People, independent of any tenant |
memberships | User ↔ tenant with a role, unique pair |
plans | Sellable plan catalog |
subscriptions | Tenant ↔ plan with billing period |
invoices | Billing documents per subscription |
Schema highlights
- Memberships cascade when a tenant or user is deleted; billing history is RESTRICT-protected
- UNIQUE (tenant_id, user_id) prevents duplicate memberships at the database level
- Plan catalog separated from subscriptions so pricing changes never rewrite history
- Ships with a starter glossary and Email / Money / Status Code domains — naming compliance starts at 100%
How to use it
- Click Open in Sqemo — the template loads as a new local project (nothing is uploaded, no account needed).
- Rename entities and attributes; physical names follow your glossary and naming rules automatically.
-
Export
CREATE TABLESQL for MySQL, PostgreSQL, SQL Server, Oracle, SQLite, H2, or CUBRID — or DBML.
Prefer your own baseline? Import SQL or DBML and Sqemo builds the diagram, foreign keys included.