Back to blog

Blog

How to Draw a Microservices Architecture Diagram That Lasts

How to draw a microservices architecture diagram reviewers trust: what to include, sync vs async arrows, data ownership, C4 levels and a worked example.

how to draw a microservices architecture diagramUpdated 11/9/2026Shafi Khan

How to Draw a Microservices Architecture Diagram That Lasts

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.

ElementWhat to drawWhere the truth lives
Clients and entry pointWeb, mobile, partner APIs, the API gatewayGateway routes, DNS, ingress config
ServicesOne box per deployable service, labeled with owning teamRepos, deployment manifests, service catalog
Data storesThe database, cache or bucket each service owns, placed next to itService config, IaC
Synchronous edgesRequest/response calls (HTTP, gRPC)Client config, env vars, service mesh routes
Asynchronous edgesPublish to topic/queue, consume from topic/queueBroker topic list, consumer groups, code
External dependenciesPayment providers, email APIs, SaaSConfig, secrets inventory
Runtime platformThe cluster or serverless platform, as one boundaryIaC, platform console
Trust boundariesPublic edge, internal network, third-party zoneNetwork 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.

VisualMeaningFailure behavior to expect
Solid arrow, labeled protocol (HTTP, gRPC)Caller waits for a responseCallee down means caller errors or times out
Dashed arrow into a named topic or queueProducer publishes and continuesBroker absorbs the message; consumers catch up later
Dashed arrow out of a topic or queueConsumer subscribesConsumer down means a growing backlog, not a caller error
Thick or red solid chainSynchronous call chain three or more hops deepLatency 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:

FromToTypeEvidenceDraw it as
Web and mobile clientsAPI gatewaySync, HTTPSDNS and gateway listenerEntry point on the public edge
API gatewayordersSync, HTTPGateway route /ordersSolid arrow
ordersorders-db (PostgreSQL)DataDATABASE_URLOwned store, placed beside orders
ordersinventorySync, HTTPINVENTORY_URLSolid arrow, labeled "reserve stock"
orderspaymentsSync, HTTPPAYMENTS_URLSolid arrow, labeled "authorize"
paymentsPayment providerSync, HTTPSProvider SDK configArrow into the third-party zone
ordersTopic order-placedAsync, publishORDER_EVENTS_TOPICDashed arrow into Kafka
Topic order-placednotificationsAsync, consumeConsumer group notificationsDashed arrow out of Kafka
Topic order-placedanalyticsAsync, consumeConsumer group analyticsDashed arrow out of Kafka
notificationsEmail APISync, HTTPSProvider configArrow 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-db except orders. If analytics needs order data, it gets it from the order-placed event.

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:

SituationHow C4 models itWhat your diagram looks like
One team owns all the servicesEach microservice is "a group of one or more containers" (for example an API plus its database schema) inside one software systemOne container diagram, with each API and its schema grouped by color or a box
Separate teams own the servicesEach service is promoted to its own software systemEach 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:

  1. System context: the shop, its users and its third parties. One page, no service internals.
  2. Container view: the services, data stores, broker and gateway from the example above.
  3. 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

FAQ

Questions readers ask before they act on this page.

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.

Related reading

Keep moving through the architecture workflow.

Free tool

Docker Compose Diagrammer

Quickly explain local platform topologies, integration stacks, and migration candidates by turning compose files into a visual dependency map.

docker compose visualizercompose file diagramcontainer topology mapper

Free tool

Kubernetes YAML Visualizer

Read Deployments, Services, Ingresses, StatefulSets, and ConfigMaps as one system view instead of a folder full of YAML files.

kubernetes manifest visualizerk8s yaml diagramkubernetes topology tool

Free tool

Architecture Review Checklist Builder

Build repeatable review packets for cloud architectures, migrations, data systems, and internal platforms without relying on static spreadsheets.

system design review checklistarchitecture governance checklistdesign review template

Free tool

STRIDE Threat Checklist

Walk through spoofing, tampering, repudiation, information disclosure, denial of service, and elevation risks using a deterministic system model.

threat modeling checkliststride templatesecurity review checklist

Guide

What service boundaries means in Microservices and Distributed Systems

What service boundaries means in Microservices and Distributed Systems with technical review guidance, practical artifacts, and a workflow path into diagrams, documentation, and architecture governance.

microservices architectureservice boundariesdistributed systems design

Guide

What async messaging means in Microservices and Distributed Systems

What async messaging means in Microservices and Distributed Systems with technical review guidance, practical artifacts, and a workflow path into diagrams, documentation, and architecture governance.

microservices architectureasync messagingdistributed systems design

Comparison

Architecto vs Structurizr

Architecto vs Structurizr with a workflow-first comparison across diagrams, architecture review, technical documentation, and code-adjacent implementation evidence.

structurizr alternativearchitecto vs structurizrbrand comparison
How to Draw a Microservices Architecture Diagram That Lasts | Architecto