Keep a large database readable with linked ER diagrams

Split a big schema into subject-area ER diagrams, add an overview that links to each one, and keep shared tables consistent, instead of drawing one diagram nobody can read.

Mermaid diagrams · Updated November 24, 2026 · 4 min read

An ER diagram of a 120-table database is technically complete and practically useless. The lines cross, the labels overlap, and a reader zooming around it can't answer the question they came with. The fix isn't a better layout engine. It's several smaller diagrams, each answering one question, plus one overview that shows how they fit together.

Split by subject area

Group tables by the part of the business they describe, not by schema name or alphabetically. Typical areas for an online shop:

  • Customers: accounts, addresses, preferences, consent.
  • Catalog: products, variants, categories, prices.
  • Orders: orders, order lines, payments, refunds.
  • Fulfilment: shipments, warehouses, stock movements.

A good area has between five and fifteen tables and a reason to be read on its own: a team owns it, a service reads it, or a feature lives in it. If an area needs more than about fifteen tables, split it again.

Some tables belong to more than one area. PRODUCT appears in the catalog and in orders; CUSTOMER appears almost everywhere. That's fine, as long as you follow the next rule.

Show shared tables the same way everywhere

In the area that owns a table, show it fully: all the attributes the discussion needs, with keys marked. Everywhere else, show it as a reference: the same name and only its primary key, so readers can tell at a glance that they're looking at a visitor.

erDiagram
  CUSTOMER ||--o{ PURCHASE_ORDER : places
  PURCHASE_ORDER ||--|{ ORDER_LINE : contains
  PRODUCT ||--o{ ORDER_LINE : "is ordered as"
  PURCHASE_ORDER ||--o{ PAYMENT : "is paid by"
  CUSTOMER {
    int id PK
  }
  PRODUCT {
    int id PK
  }
  PURCHASE_ORDER {
    int id PK
    int customer_id FK
    string status
    date placed_on
  }
  ORDER_LINE {
    int order_id PK, FK
    int line_number PK
    int product_id FK
    int quantity
  }
  PAYMENT {
    int id PK
    int order_id FK
    decimal amount
  }
  classDef visitor fill:#f4f4f2,stroke-dasharray: 4 3
  class CUSTOMER,PRODUCT visitor

The dashed, grey CUSTOMER and PRODUCT boxes say "defined elsewhere". Use the same names in every diagram, spelled the same way. Search only finds CUSTOMER in every diagram that uses it if it's never called CUSTOMERS or Customer somewhere else.

Draw an overview

The overview has one box per area's main table, or one box per area, and only the relationships that cross area boundaries. It doesn't need attributes:

erDiagram
  direction LR
  CUSTOMER ||--o{ PURCHASE_ORDER : places
  PRODUCT ||--o{ PURCHASE_ORDER : "appears in"
  PURCHASE_ORDER ||--o{ SHIPMENT : "is sent as"
  WAREHOUSE ||--o{ SHIPMENT : dispatches

This is the diagram for onboarding, architecture reviews, and "where does this data live?" questions. It's small on purpose: if it grows past a dozen boxes, the areas are too fine.

In Flowgraph Studio, put the overview and the area diagrams in one project, then open the overview and choose Linked diagrams in the top bar. Pick an entity, such as PURCHASE_ORDER, and pick the diagram it should open, such as the orders area. Linked entities get a badge on the canvas. Clicking the badge opens the detail diagram, and Back in the top bar returns to the overview with that entity outlined.

Readers can then start at the top and drill into the area they care about, the way they would with a map.

Build the areas from your schema

You don't have to draw each area by hand:

  • New diagram → Start from → From a SQL schema reads CREATE TABLE statements and migrations in your browser. For a schema of more than 60 tables, it asks which tables to include, so you can import one area at a time from the same file. See Convert SQL to an ER diagram.
  • Import from GitHub draws the data model from a repository's schema dump, migrations, or Prisma schema.

Then trim each diagram to what its readers need. Audit columns such as created_at and updated_by on every table are usually noise; leave them out and say so once in the project description.

Arrange each diagram once

A diagram with ten entities is small enough to arrange by hand. Try the Layout tab first: left to right often suits a chain of tables, and a different engine can untangle crossing lines. When it's close, switch to Manual mode and drag the entities where they read best, usually the area's main table in the middle with its children around it. Positions are saved with the diagram, so the next person sees the same picture.

Keep the set current

A set of diagrams goes stale one table at a time. A few habits help:

  • Give each area diagram an owner. Signed in, open Review status (the badge in a diagram's top bar) to set one and choose how often it should be reviewed again.
  • When a migration adds or changes tables, update the area that owns them in the same pull request. Check the visitors in other areas only when a primary key changes.
  • Use Search on the Projects page to find every diagram that mentions a table before you rename or drop it. It looks inside diagrams, not just at their names.
  • Choose Mark as reviewed after checking a diagram against the schema. If its content changes later, it shows Changed since review, and Needs review in the Projects sidebar lists the diagrams waiting for a look.

For keys, cardinality, and line styles, the ER relationship cheat sheet has every symbol. For organising projects of any kind of diagram, see Organize a large set of diagrams.

More guides