App
DocsTutorialsTutorial 8: Create a Spring Boot Architecture Diagram

Create a Spring Boot Architecture Diagram

What you'll build

In this tutorial, you will design an enterprise-grade Java Spring Boot microservices topology consisting of:

  • A Spring Cloud API Gateway for edge routing and rate limiting.
  • A Eureka Service Discovery Registry.
  • Three domain microservices: Order Service, Inventory Service, and Customer Service.
  • An Apache Kafka event bus for asynchronous domain event publishing.
  • Dedicated PostgreSQL databases adhering to the Database-per-Service pattern.

Before you start


Step 1: Add the Gateway and Discovery Services

  1. Drop an Architecture Node (A) at the top center. Label it Spring Cloud Gateway, icon Spring Boot.
  2. Drop another node to the top right of the gateway. Label it Eureka Discovery Server, icon Spring Boot.
  3. Connect Spring Cloud Gateway to Eureka Discovery Server with a dashed line labeled heartbeat / registry lookup.

Step 2: Add the Domain Microservices

  1. Below the gateway, place three architecture nodes in a horizontal row:
    • Node 1: Label Order Service, icon Spring Boot.
    • Node 2: Label Inventory Service, icon Spring Boot.
    • Node 3: Label Customer Service, icon Spring Boot.
  2. Connect Spring Cloud Gateway to each of the three services with directional arrows labeled:
    • To Order Service: REST /api/v1/orders
    • To Inventory Service: REST /api/v1/inventory
    • To Customer Service: REST /api/v1/customers

Step 3: Implement Database-per-Service

In modern microservice design, services should never share a raw database:

  1. Place an Ellipse (O) or Architecture Node beneath each microservice:
    • Under Order Service: Label Orders DB, icon PostgreSQL.
    • Under Inventory Service: Label Inventory DB, icon PostgreSQL.
    • Under Customer Service: Label Customers DB, icon PostgreSQL.
  2. Connect each service to its respective database with an arrow labeled Spring Data JPA / JDBC.

Step 4: Add Asynchronous Messaging with Apache Kafka

  1. Place an Architecture Node between the services and databases. Label it Apache Kafka Cluster, icon Kafka.
  2. Connect Order Service to Apache Kafka Cluster with a directional arrow:
    • Label: pub: order-created-event.
  3. Connect Apache Kafka Cluster to Inventory Service:
    • Label: sub: order-created-event (reserve stock).

Review the generated architecture

  • Verify the distinct tiers: Gateway & Registry on Tier 1, Domain Services on Tier 2, Event Broker on Tier 3, and Data Stores on Tier 4.
  • Notice how the Database-per-Service boundary is visually clear.
  • Confirm that synchronous HTTP traffic and asynchronous Kafka event flows use distinct connector labels.

Customize the diagram

  1. Select the Rectangle tool (R) and draw a container around the three services and Kafka.
  2. Label the container Spring Boot Microservices Cluster (K8s Namespace: prod).
  3. Set the boundary stroke to Dashed and send it to the background (Cmd/Ctrl + Shift + [).

Export your result

  1. Click Export to save a crisp 2x PNG image for team architecture documentation.
  2. Click Export Markdown to generate a Markdown breakdown of all Spring Boot components, databases, and Kafka streams.
  3. Commit the markdown to your team's Git wiki.

Tips

  • Use different connector stroke colors (e.g. blue for synchronous REST and purple for asynchronous Kafka events) to visually differentiate communication protocols.

Limitations

  • When building large topologies with 20+ microservices, consider grouping services into sub-domain boundaries (e.g. Order Sub-domain, Billing Sub-domain) to keep the diagram readable.
Need help? Contact Support