How to draw a microservices architecture diagram, the short version: put the entry point at the edge, draw each service with the data store it owns and the team that owns it, then draw two kinds of arrows: solid for synchronous calls, dashed through the broker for async events. Only draw an edge you can point to in config, code or the broker itself.
Most microservices diagrams are either a spaghetti poster where nobody can tell a REST call from a Kafka event, or five hexagons and a vibe that haven't matched production since 2023. Both fall apart the moment on-call asks "if payments is down, what breaks?"
Below: what to include, how to draw sync versus async without lying, a worked microservices architecture diagram example, how the C4 model handles microservices, and a review checklist.
What should a microservices architecture diagram include?
A good diagram answers four questions fast: who calls in, which services exist, who owns which data, and what breaks when something fails. Everything on the page should serve one of those.
Microsoft's microservices architecture style guide lists the core components: services, an API gateway as the entry point for clients, data management where "each service owns its data and schema", message-oriented middleware such as Apache Kafka or Azure Service Bus, and a management or orchestration layer such as Kubernetes. That's a solid skeleton for your legend.
| Element | What to draw | Where the truth lives |
|---|---|---|
| Clients and entry point | Web, mobile, partner APIs, the API gateway | Gateway routes, DNS, ingress config |
| Services | One box per deployable service, labeled with owning team | Repos, deployment manifests, service catalog |
| Data stores | The database, cache or bucket each service owns, placed next to it | Service config, IaC |
| Synchronous edges | Request/response calls (HTTP, gRPC) | Client config, env vars, service mesh routes |
| Asynchronous edges | Publish to topic/queue, consume from topic/queue | Broker topic list, consumer groups, code |
| External dependencies | Payment providers, email APIs, SaaS | Config, secrets inventory |
| Runtime platform | The cluster or serverless platform, as one boundary | IaC, platform console |
| Trust boundaries | Public edge, internal network, third-party zone | Network policy, security groups |
Keep it readable: one box per deployable unit (not per class or replica), and collapse services that don't matter to the question into a labeled group.
If your team is still arguing about where one service ends and the next begins, sort that out first. The service boundaries explainer is a good place to settle it before you draw anything.
→ Sketch your first-pass service map from a plain-English prompt with Architect AI
Synchronous vs asynchronous communication in architecture diagrams
This is where most microservices diagrams lie. A solid arrow from Orders to Notifications looks identical whether Orders makes a blocking HTTP call or drops an event on Kafka and moves on. Those are completely different failure modes, so they need completely different visuals.
| Visual | Meaning | Failure behavior to expect |
|---|---|---|
| Solid arrow, labeled protocol (HTTP, gRPC) | Caller waits for a response | Callee down means caller errors or times out |
| Dashed arrow into a named topic or queue | Producer publishes and continues | Broker absorbs the message; consumers catch up later |
| Dashed arrow out of a topic or queue | Consumer subscribes | Consumer down means a growing backlog, not a caller error |
| Thick or red solid chain | Synchronous call chain three or more hops deep | Latency and failure stack up along the chain |
The most important habit: never draw an async edge directly between two services. Route it through the broker and name the topic. "Orders → Notifications" hides every other consumer of order-placed; "Orders → order-placed → Notifications, Analytics" tells the truth.
That third row in the table matters too. Microsoft's guide warns that "if the chain of service dependencies gets too long (service A calls B, which calls C...), the extra latency can become a problem" and suggests looking for places to use asynchronous patterns instead. A diagram that makes long sync chains visually loud is a diagram that surfaces that problem in review instead of in production.
Want the deeper trade-offs between queues, topics and request/response? The async messaging explainer walks through them.
→ Map the call order behind a sync chain with Flow IQ's sequence diagram designer
How to draw a microservices architecture diagram in 6 steps
This is the workflow that produces a diagram you can defend. It pulls from config and the broker, not from memory.
1. Pin the scope and the question. One environment, one domain, one question. "What happens between checkout and a confirmation email in prod?" is a diagram. "The whole platform" is a poster nobody reads.
2. Inventory the deployable services. List every service in scope with its owning team. If you deploy to Kubernetes, the workloads are your source of truth:
kubectl get deployments,statefulsets -n shop
3. Attach each service's data. Put each database, cache or bucket right next to the service that owns it. Microsoft's guidance is explicit: "Data storage should be private to the service that owns the data." If you find a database with arrows from three services, don't hide it. Draw it, and flag it.
4. Draw synchronous edges from evidence. Every solid arrow needs a source: an env var like PAYMENTS_URL, a client config, a gateway route or a service mesh rule. No evidence, no arrow.
5. Draw asynchronous edges from the broker. Ask the broker what exists instead of guessing. With Kafka's CLI tools:
kafka-topics.sh --bootstrap-server localhost:9092 --list
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups
The first command lists topics. The second shows each consumer group with the topics and partitions it's reading, which is exactly the "who consumes what" half of your dashed arrows.
6. Add owners, boundaries and a timestamp. Label each service with its team, draw the public edge and third-party zone, and stamp the diagram with the date and the sources you used.
Running the stack locally with Compose? Our Docker Compose network diagram guide shows how to read networks, ports and depends_on before you draw. Running on Kubernetes? The Kubernetes architecture diagram guide covers the selector checks that prove a Service actually reaches its pods.
→ Turn your compose file into a first-pass dependency map with the free Docker Compose Diagrammer
Microservices architecture diagram example: an online shop
Let's draw a small but realistic system: an online shop with five services, one gateway, one Kafka cluster and two third-party APIs.
Here's the slice of config for the orders service that tells you most of its edges:
# orders service: deployment environment
env:
- name: DATABASE_URL
value: postgres://orders-db:5432/orders
- name: PAYMENTS_URL
value: http://payments:8080
- name: INVENTORY_URL
value: http://inventory:8080
- name: KAFKA_BOOTSTRAP_SERVERS
value: kafka:9092
- name: ORDER_EVENTS_TOPIC
value: order-placed
Combine that with the gateway routes and the consumer groups from step 5, and the full edge list looks like this:
| From | To | Type | Evidence | Draw it as |
|---|---|---|---|---|
| Web and mobile clients | API gateway | Sync, HTTPS | DNS and gateway listener | Entry point on the public edge |
| API gateway | orders | Sync, HTTP | Gateway route /orders | Solid arrow |
orders | orders-db (PostgreSQL) | Data | DATABASE_URL | Owned store, placed beside orders |
orders | inventory | Sync, HTTP | INVENTORY_URL | Solid arrow, labeled "reserve stock" |
orders | payments | Sync, HTTP | PAYMENTS_URL | Solid arrow, labeled "authorize" |
payments | Payment provider | Sync, HTTPS | Provider SDK config | Arrow into the third-party zone |
orders | Topic order-placed | Async, publish | ORDER_EVENTS_TOPIC | Dashed arrow into Kafka |
Topic order-placed | notifications | Async, consume | Consumer group notifications | Dashed arrow out of Kafka |
Topic order-placed | analytics | Async, consume | Consumer group analytics | Dashed arrow out of Kafka |
notifications | Email API | Sync, HTTPS | Provider config | Arrow into the third-party zone |
Look at what the table makes obvious that a box-and-line slide hides:
- Checkout is a sync chain: gateway →
orders→payments→ payment provider. If the provider is slow, the customer is waiting on all four hops. That's a design conversation (timeouts, retries, idempotency keys), and the diagram should make it loud. - Notifications can't break checkout. It sits behind the broker. If it's down, emails queue up as consumer lag instead of failing orders.
- Data stays private. No service reaches into
orders-dbexceptorders. If analytics needs order data, it gets it from theorder-placedevent.
That last point is where consistency trade-offs live. When an order touches inventory and payments, you're no longer in single-database ACID territory. The data consistency explainer covers how teams handle that.
→ Threat-model the payment path and third-party edges with Threat Analyzer
C4 model for microservices: which level to draw
The C4 model is the cleanest way to stop arguing about "how much detail" because it gives you levels: system context, containers, components and code. For microservices, the interesting question is where services land.
The C4 model's own guidance on microservices gives two options, and the deciding factor is team ownership:
| Situation | How C4 models it | What your diagram looks like |
|---|---|---|
| One team owns all the services | Each microservice is "a group of one or more containers" (for example an API plus its database schema) inside one software system | One container diagram, with each API and its schema grouped by color or a box |
| Separate teams own the services | Each service is promoted to its own software system | Each team keeps its own system context and container diagrams |
In practice: if one team runs all five shop services, one container diagram is enough. If payments has its own team and on-call rotation, give it its own system context and treat it as an external system everywhere else.
Practical stack of diagrams for most teams:
- System context: the shop, its users and its third parties. One page, no service internals.
- Container view: the services, data stores, broker and gateway from the example above.
- Sequence diagrams for the critical flows: checkout, refunds, order cancellation. These show the order of sync calls and events that a static topology can't.
If you prefer writing C4 as code, we compared that workflow in Architecto vs Structurizr, and the broader trade-off is in our diagram as code vs drag and drop breakdown.
→ Draw the checkout sequence and the container view side by side in Flow IQ
Microservices dependency diagram: making blast radius visible
The container view tells you what exists. A dependency diagram answers the question on-call actually asks: if this service is down, what breaks?
Start from your edge table and filter to synchronous edges only. Async edges absorb failure into backlog; sync edges propagate it. Then, for each service, count:
- Sync callers (fan-in): how many services fail or degrade if it's down.
- Sync dependencies (fan-out): how many things must be up for it to work.
- Longest sync chain through it: the latency and failure budget it sits on.
In the shop example, payments has one sync caller but sits in the middle of the longest chain, so it's the most important service to give timeouts and a clear degradation story. notifications has zero sync callers, so it's the cheapest service to have an outage on.
Diagrams drawn from memory drift from the code fast, so check the repo before you redraw.
→ Check service structure and hotspots against the real repo with Code Analysis
Microservices diagram review checklist
Run this before the diagram goes into a design doc or an architecture review:
- Scope is stated: environment, domain and the question the diagram answers
- One box per deployable service, labeled with its owning team
- Each data store sits next to the single service that owns it
- Any shared database is drawn and flagged, not hidden
- Synchronous edges are solid and labeled with protocol and purpose
- Asynchronous edges go through a named topic or queue, never service to service
- Every consumer of each topic is drawn, not just the obvious one
- Sync chains of three or more hops are visually highlighted
- Clients enter through the gateway on the public edge
- Third-party APIs sit in their own zone with trust boundaries
- Critical flows have a sequence diagram alongside the topology
- The diagram has a date and lists the sources each edge came from
→ Turn this checklist into a reusable template with the Architecture Review Checklist Builder
Key takeaways
- Draw services with the data they own. Data placement is half the architecture.
- Two arrow styles, always: solid for sync calls, dashed through a named topic or queue for async events.
- Every edge needs evidence: an env var, a gateway route or a consumer group.
- Use C4 by ownership: one team means services are container groups; separate teams means separate software systems.
- Make sync chains loud. They're where latency and outages stack up.
More templates and explainers for this kind of system live in our microservices architecture diagram examples and guides.
→ Generate a microservices topology to start from with Architect AI
FAQ
What should a microservices architecture diagram include?
The clients and entry point (usually an API gateway), every service in scope with its owning team, each service's own data store, the message broker and its topics or queues, external dependencies, and the communication between them, with synchronous calls and asynchronous events drawn differently. Add a date and the source each arrow came from.
How do you show asynchronous communication in a microservices diagram?
Route asynchronous flows through the broker instead of drawing a direct line between services. Draw the producer publishing to a named topic or queue, then each consumer subscribing to it, using a dashed line style that is clearly different from solid synchronous request arrows.
Should each microservice have its own database on the diagram?
Draw the data store each service owns next to that service. Microsoft's Azure Architecture Center guidance says each service owns its data and schema and that data storage should be private to the owning service, so a database with arrows from several services is a coupling smell worth flagging in review.
Can I use the C4 model for microservices?
Yes. The C4 model documents two options: if one team owns the services, model each microservice as a group of containers (for example an API and its database schema) inside one software system; if separate teams own them, promote each service to its own software system with its own diagrams.
→ Compare Architecto with Eraser for technical diagrams
Ship a microservices diagram on-call actually trusts
The diagram nobody updates is worse than no diagram, because people still believe it at 3 a.m. Build yours from evidence: config for sync calls, the broker for async flows, and ownership for where the boxes go.
Start from what exists today, then move the target-state design into Architecto when you're ready to review threats, scale and documentation in one place.
→ Start free and build your microservices architecture in Architecto
→ Find bottlenecks in your service topology with Scalability Analyzer