Entity Relationship Diagram (ERD)
An Entity Relationship Diagram (ERD) is a visual representation of an org's data model: the entities (objects), their fields, and the relationships between them.
Definition
An Entity Relationship Diagram (ERD) is a visual representation of an org's data model: the entities (objects), their fields, and the relationships between them. In Salesforce, ERDs are used to document the schema, plan changes, communicate the data structure to non-technical stakeholders, and audit cross-object dependencies. Salesforce''s Schema Builder is the platform''s built-in ERD tool, showing a drag-and-drop graph of objects with their relationships; third-party tools (Lucidchart, draw.io, ER/Studio) generate richer ERDs from the org''s metadata via the Tooling API.
ERDs use standard notation: entities as boxes with fields listed inside, relationships as lines between boxes with crow''s-foot notation showing cardinality (one-to-one, one-to-many, many-to-many). In Salesforce, master-detail and lookup relationships have distinct visual treatments. Architects sketch ERDs before building anything; admins maintain them as living documents that update with each schema change.
How ERDs support Salesforce data modeling
What an ERD shows
An ERD shows entities, their attributes, and relationships. In Salesforce: each object is a box with its custom fields listed. Each relationship (master-detail or lookup) is a line connecting two boxes. The line''s endpoints indicate cardinality: a crow''s-foot indicates many, a single line indicates one. Relationship type (lookup vs master-detail) is often shown by line style or annotation.
Schema Builder as Salesforce''s built-in ERD tool
Setup, then Schema Builder, opens a visual canvas showing your org''s objects and their relationships. Drag objects onto the canvas; the platform draws relationships automatically. You can also create new objects, add fields, and define relationships directly in Schema Builder. The result is both a working ERD and an interactive way to build the schema.
Third-party ERD tools
Lucidchart, draw.io, ERStudio, and Dataedo offer richer ERD capabilities than Schema Builder: better visual styling, change tracking, multi-org comparison, generated documentation. They typically connect to Salesforce via the Tooling API, query EntityDefinition and EntityParticle, and render an ERD based on the live schema. Many architects use Schema Builder for daily work and third-party tools for formal documentation.
ERDs as planning documents
Before implementing a new feature, architects sketch the data model: which objects exist, what fields they hold, how they relate. An ERD is the artifact that captures this. Reviewing the ERD with stakeholders (developers, admins, business analysts) catches design issues before they become implementation work. This is project-cycle ERD usage; it predates the schema, not documents it.
ERDs as documentation
Mature Salesforce orgs maintain a living ERD that reflects the current schema. Updates flow as objects and fields change. The ERD lives in a shared documentation system (Confluence, SharePoint, GitHub Pages) and is referenced during onboarding, troubleshooting, and integration planning. Stale ERDs are common; ones that match production rare.
Cross-org and multi-app ERDs
Enterprises with multiple Salesforce orgs (US production, EU production, sandboxes, partner orgs) need ERDs spanning orgs. Third-party tools can generate combined ERDs comparing schemas across orgs, useful for migration planning and schema drift detection. This is harder than single-org ERDs but more valuable at enterprise scale.
ERDs in compliance and audit contexts
Regulated industries (financial services, healthcare, government) often require formal data flow documentation. ERDs are part of this: they show what data the org holds, what relationships connect it, what dependencies exist between systems. Auditors examine ERDs to confirm the documented model matches the deployed schema.
How to generate an ERD for a Salesforce org
Generating an ERD takes 15 minutes to 8 hours depending on org complexity and tool chosen. Schema Builder is fastest for ad-hoc visualization; third-party tools produce more polished documentation.
- Open Schema Builder
Setup, then Schema Builder. The canvas opens with no objects displayed. Use the left sidebar to add objects to the canvas.
- Add objects to the canvas
Select the objects relevant to your ERD. Common starting points: Account, Contact, Opportunity, Case, and any custom objects that integrate with them. The relationships draw automatically as you add objects.
- Adjust the layout
Drag objects around the canvas to make the diagram readable. Group related objects together. Schema Builder does not auto-layout; you arrange manually.
- Export or screenshot
Schema Builder lets you take a screenshot of the canvas or export as PDF. For richer formats, use a third-party tool that connects via the Tooling API.
- Connect a third-party ERD tool (optional)
Lucidchart and draw.io support Salesforce connectors. Sign in to your org through the tool, select objects to include, and the tool renders an ERD with standard ERD notation, better styling, and export options.
- Save and share the ERD
Save the ERD to your documentation system (Confluence, Notion, GitHub). Update it on a defined cadence (quarterly is common) or after every major schema change.
Salesforce''s interactive ERD tool. Drag-and-drop, decent for ad-hoc visualization, limited for formal documentation.
Cloud diagramming tool with a Salesforce data import. Better visual styling and export.
Documentation tool specializing in metadata-driven ERDs. Generates documentation alongside the diagrams.
Build your own ERD generator by querying EntityDefinition and EntityParticle and emitting Mermaid, GraphViz, or another diagram format.
- Schema Builder does not export usable XML for sharing. Screenshots are the workaround; third-party tools produce richer formats.
- Auto-generated ERDs from large orgs are overwhelming. A 500-object diagram is unreadable; group related objects into multiple smaller ERDs.
- Relationship types are not always obvious in ERDs. Master-detail vs lookup is critical for behavior; annotate clearly when the tool''s defaults are ambiguous.
- Living ERDs drift quickly. Without a process to update them after schema changes, they become misleading documentation rather than authoritative.
Trust & references
Straight from the source - Salesforce's reference material on Entity Relationship Diagram (ERD).
- Schema BuilderSalesforce Help
Hands-on resources to go deeper on Entity Relationship Diagram (ERD).
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What does an ERD show?
Q2. What's Salesforce's built-in ERD tool?
Q3. Why maintain an ERD?
Discussion
Loading discussion…