ERData modelSimple
SaaS multi-tenant schema
Tenants, users, roles, and resources for a row-level multi-tenant SaaS database.
What this diagram shows
Step 01
Tenant root
Every user and resource is owned by exactly one tenant — the isolation boundary.
Step 02
Role assignments
Users pick up permissions through role assignment rows, not direct fields.
Step 03
Shared schema
All tenants share the same tables, separated by tenant_id columns.
About er diagrams
Entity-relationship diagrams sketch the shape of a data model: tables, their fields, and how they reference each other. They help when planning schemas or explaining a database at a glance.
This template is written in Mermaid — plain text you can edit, version in git, and regenerate the image from any time.
View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
diagram.mmd
1erDiagram2 TENANT ||--o{ USER : has3 TENANT ||--o{ RESOURCE : owns4 USER ||--o{ ROLE_ASSIGNMENT : granted5 ROLE ||--o{ ROLE_ASSIGNMENT : grants67 TENANT {8 uuid id9 text name10 text plan11 }12 USER {13 uuid id14 uuid tenant_id15 text email16 }17 ROLE {18 uuid id19 text name20 }21 ROLE_ASSIGNMENT {22 uuid user_id23 uuid role_id24 }25 RESOURCE {26 uuid id27 uuid tenant_id28 text kind29 }Related
Related templates
More templates that cover similar workflows.