Skip to main content

2 posts tagged with "database"

View All Tags

Database Schema Diagrams in Confluence with Mermaid ER (Copy-Paste)

· 5 min read

The bug report says "orders show twice in the report" and the fix takes three days because nobody on the team is sure whether order_lines links to orders on order_id or source_order_id, and both columns exist. The schema is documented — in a schema.md that lists columns as bullets and a diagram that was last exported when the DB was two migrations younger. The join question is exactly the thing an ER diagram answers at a glance, and the thing a bulleted column list cannot answer at all.

Quick answer: document the database schema in Confluence as a Mermaid erDiagram, rendered by Mermaid Plus for Confluence. Entities hold keys and attributes; relationship lines carry the cardinality and the join's noun. When the discussion turns to the domain model the code exposes, add a classDiagram on the same page. This post gives you three copy-paste examples.

ER Diagrams in Confluence: How to Add, Create, and Render Database Schemas

· 21 min read

An ER diagram (entity-relationship diagram) visualizes a database schema — the tables, columns, primary and foreign keys, and the relationships between them. If your team documents data models, API contracts, or system architecture in Confluence, embedding ER diagrams directly on the page keeps the schema next to the prose instead of stranded in an external tool as a stale screenshot.

Confluence has no built-in ER diagram support, so you add it with a Marketplace app. The approach below uses Mermaid Plus for Confluence, which renders ER diagrams from plain text — meaning diagrams version, diff, and search alongside the rest of your documentation.

What you'll learn
  1. How to add an ER diagram to any Confluence page
  2. The full Mermaid erDiagram syntax — entities, attributes, key types, cardinality
  3. Three copy-paste examples (library, e-commerce, SaaS multi-tenant)
  4. Common mistakes and how to fix them

Entity-Relationship (ER) diagrams are the standard way to visualize database schemas. They show the tables in your database, the columns in each table, primary and foreign key constraints, and the relationships between tables -- one-to-one, one-to-many, and many-to-many. Whether you are designing a new database from scratch, documenting an existing schema for onboarding, or collaborating on a data model before writing migration scripts, an ER diagram communicates structure faster than any amount of prose.