HomeTemplatesER Diagrams

Mermaid ER Diagrams Templates

Mermaid ER diagram templates for database schema design — blogs, SaaS, e-commerce.

3 templates · Click "Use in Editor" to open any template and customize it instantly. No sign-up required.

Blog Platform

Blog database schema: User, Post, Comment, Tag with many-to-many.

erDiagram
    USER {
        int id PK
        string username UK
        string email UK
        string password_hash
        datetime created_at
    }
    POST {
        int id PK
        string title
        string slug UK
        text content
        string status
        int author_id FK
        datetime published_at
    }
    COMMENT {
        int id PK
        text body
        int post_id FK
        int author_id FK
        datetime created_at
    }
    TAG {
        int id PK
        string name UK
    }
    POST_TAG {
        int post_id FK
        int tag_id FK
    }

    USER ||--o{ POST : writes
    USER ||--o{ COMMENT : writes
    POST ||--o{ COMMENT : has
    POST ||--o{ POST_TAG : has
    TAG ||--o{ POST_TAG : tagged
Use in Editor →

SaaS Multi-Tenant

Multi-tenant SaaS schema: Tenant, User, Project, Task.

erDiagram
    TENANT {
        int id PK
        string name
        string subdomain UK
        string plan
        datetime created_at
    }
    USER {
        int id PK
        int tenant_id FK
        string email
        string role
    }
    PROJECT {
        int id PK
        int tenant_id FK
        string name
        int owner_id FK
    }
    TASK {
        int id PK
        int project_id FK
        string title
        string status
        int assignee_id FK
        date due_date
    }

    TENANT ||--o{ USER : has
    TENANT ||--o{ PROJECT : owns
    USER ||--o{ PROJECT : manages
    PROJECT ||--o{ TASK : contains
    USER ||--o{ TASK : assigned
Use in Editor →

E-commerce DB

Full e-commerce database: Customer, Orders, Products, Categories.

erDiagram
    CUSTOMER {
        int id PK
        string name
        string email UK
    }
    ADDRESS {
        int id PK
        int customer_id FK
        string street
        string city
        string zip
        string country
    }
    ORDERS {
        int id PK
        int customer_id FK
        int shipping_address_id FK
        string status
        decimal total
        datetime ordered_at
    }
    ORDER_ITEM {
        int id PK
        int order_id FK
        int product_id FK
        int quantity
        decimal unit_price
    }
    PRODUCT {
        int id PK
        string name
        string sku UK
        decimal price
        int category_id FK
    }
    CATEGORY {
        int id PK
        string name
        int parent_id FK
    }

    CUSTOMER ||--o{ ADDRESS : has
    CUSTOMER ||--o{ ORDERS : places
    ORDERS ||--|{ ORDER_ITEM : contains
    ORDER_ITEM }o--|| PRODUCT : references
    PRODUCT }o--|| CATEGORY : belongs_to
    ORDERS }o--|| ADDRESS : ships_to
Use in Editor →

More Template Categories