Mermaid StudioEditor

SaaS Multi-Tenant Schema

Organizations, the users they employ, and the subscription/invoice chain that bills them — the shape most B2B SaaS apps start from.

Mermaid source
erDiagram
    ORGANIZATION ||--o{ USER : employs
    ORGANIZATION ||--|| SUBSCRIPTION : has
    SUBSCRIPTION ||--o{ INVOICE : generates
    ORGANIZATION {
        int id PK
        string name
        string plan
    }
    USER {
        int id PK
        int org_id FK
        string email
        string role
    }
    SUBSCRIPTION {
        int id PK
        int org_id FK
        string tier
        date renews_at
    }
    INVOICE {
        int id PK
        int subscription_id FK
        decimal amount
        date issued_at
    }
SaaS Multi-Tenant SchemaOpen in editor →

Category: Data · Tags: database, saas, er-diagram

How to use this template

Choose Open in editor under the diagram to load this template into Mermaid Studio. Rename the boxes and arrows to match your own system, either in the code or on the visual canvas, then export it as PNG, SVG or JPEG, or copy the Mermaid code into a Markdown file. GitHub, GitLab, Notion and Obsidian all render Mermaid code blocks.

The Mermaid ER Diagram Syntax reference explains every construct this template uses, and the ER Diagram Tool page has more examples.