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, andCustomer Service. - An Apache Kafka event bus for asynchronous domain event publishing.
- Dedicated PostgreSQL databases adhering to the Database-per-Service pattern.
Before you start
- Open a blank canvas in Rekhic or start from the Microservices Platform template in the Templates Catalog.
Step 1: Add the Gateway and Discovery Services
- Drop an Architecture Node (
A) at the top center. Label itSpring Cloud Gateway, iconSpring Boot. - Drop another node to the top right of the gateway. Label it
Eureka Discovery Server, iconSpring Boot. - Connect
Spring Cloud GatewaytoEureka Discovery Serverwith a dashed line labeledheartbeat / registry lookup.
Step 2: Add the Domain Microservices
- Below the gateway, place three architecture nodes in a horizontal row:
- Node 1: Label
Order Service, iconSpring Boot. - Node 2: Label
Inventory Service, iconSpring Boot. - Node 3: Label
Customer Service, iconSpring Boot.
- Node 1: Label
- Connect
Spring Cloud Gatewayto 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
- To
Step 3: Implement Database-per-Service
In modern microservice design, services should never share a raw database:
- Place an Ellipse (
O) or Architecture Node beneath each microservice:- Under
Order Service: LabelOrders DB, iconPostgreSQL. - Under
Inventory Service: LabelInventory DB, iconPostgreSQL. - Under
Customer Service: LabelCustomers DB, iconPostgreSQL.
- Under
- Connect each service to its respective database with an arrow labeled
Spring Data JPA / JDBC.
Step 4: Add Asynchronous Messaging with Apache Kafka
- Place an Architecture Node between the services and databases. Label it
Apache Kafka Cluster, iconKafka. - Connect
Order ServicetoApache Kafka Clusterwith a directional arrow:- Label:
pub: order-created-event.
- Label:
- Connect
Apache Kafka ClustertoInventory Service:- Label:
sub: order-created-event (reserve stock).
- Label:
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
- Select the
Rectangletool (R) and draw a container around the three services and Kafka. - Label the container
Spring Boot Microservices Cluster (K8s Namespace: prod). - Set the boundary stroke to
Dashedand send it to the background (Cmd/Ctrl + Shift + [).
Export your result
- Click Export to save a crisp 2x PNG image for team architecture documentation.
- Click Export Markdown to generate a Markdown breakdown of all Spring Boot components, databases, and Kafka streams.
- 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.