Mermaid: diagramming tool, personal experience
Table of contents
Hi folks! First of all, I'd like to wish you a Happy New Year! πππ
And thank AFU for having the ability to enter 2024 with you! π
I'd like to start this year with a post about Mermaid - diagramming tool that I use for projects documentation.
Why I choose Mermaid
Back in 2023, one of my projects required to have some internal documentation in the form of diagrams. Here are requirements that I and my team had for choosing the tool:
- We wanted to have next types of diagrams: ER diagrams, Flowcharts, Sequence diagrams, diagrams to document back-end infrastructure (e.g., relations between DBs, caches, VMs, k8s, request flow, etc.).
- We wanted the possibility of collaborative work on the same diagram.
- We wanted diagrams to have versions history.
We found that Mermaid covers all our requirements. Here are some pros and cons of Mermaid that I found during my work with it.
Pros
- As it's a code-based tool - versioning and collaborative work can be done by Git.
- It supports all diagram types we need with detailed documentation and examples.
- Visual part of diagrams can be customized with CSS or predefined themes.
- It is possible to embed diagrams straight into GitHub comments or Markdown files.
- There are plugins for two popular editors/IDEs: VS Code and Intellij which allows to preview diagrams in real-time.
Cons
- As it's a code-based tool - it requires some time to learn and may not fit for non-technical people that primarily work with GUIs.
- ER diagrams with 30β40 tables are hard to read due to diagrams are rendered too wide. I'm subscribed to this GitHub issue and looking forward to see it fixed.
- ER diagrams don't support regions (e.g., to group tables by modules).
- There is no separate diagram type for documenting back-end infrastructure, but it is possible to use Flowcharts for that, see this example.
Summary
I'm happy with Mermaid and I'm going to use it in my future projects. I hope this post will help you to choose the right tool for your project.