Diagrams / Mermaid Architecture Diagram: Syntax & Examples
Mermaid Architecture Diagram: Syntax & Examples
Explore Mermaid architecture syntax with an editable service diagram. Understand groups, connection endpoints and the boundaries of an architecture view.
When to use Architecture Diagram
Use a Mermaid architecture diagram to show services, resource groups, and their connections. It is useful for explaining the boundaries of a deployed system. Decide whether each link means communication, dependency, or ownership and state that meaning in the diagram’s surrounding text.
Read the Architecture Diagram example
Diagram source
architecture-beta
group app(cloud)[Customer portal]
service web(internet)[Browser]
service api(server)[API] in app
service db(database)[Database] in app
web:R --> L:api
api:R --> L:dbHow to use this tool
- Start with the example in the editor and identify the elements that answer your question.
- Replace the sample labels and values, previewing after each structural change.
- Review the diagram at its intended reading size, then keep the source and export the format your document accepts.
Syntax and interpretation
| Concept | How to apply it |
|---|---|
| Declaration | Start with architecture-beta. Resource groups and services have distinct IDs. |
| Connections | Connection endpoints select sides of a service. Use sides to improve readability without changing what the relationship means. |
| Level of detail | Keep infrastructure resources separate from business workflows. A C4 context view may be better for a nontechnical audience. |
Common questions
Is this an automatically discovered architecture?
No. It represents the source you provide. Validate it against actual deployment information when accuracy about infrastructure matters.