0
0
Microservicessystem_design~12 mins

Bounded context mapping in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Bounded context mapping

This system demonstrates how bounded contexts in a microservices architecture are mapped and interact. Each bounded context represents a distinct domain with its own data and logic, communicating through well-defined interfaces. The key requirement is to maintain clear boundaries to avoid data conflicts and enable independent service evolution.

Architecture Diagram
User
  |
  v
+----------------+
| API Gateway    |
+----------------+
  |          |
  v          v
+---------+  +---------+
| Order   |  | Payment |
| Service |  | Service |
+---------+  +---------+
  |            |
  v            v
+---------+  +---------+
| Order   |  | Payment |
| DB      |  | DB      |
+---------+  +---------+

Legend:
- API Gateway routes requests
- Order Service handles order domain
- Payment Service handles payment domain
- Each service has its own database
- Services communicate asynchronously via message queue

+----------------+
| Message Queue  |
+----------------+
       ^
       |
+----------------+
| Shipping       |
| Service        |
+----------------+
       |
       v
+----------------+
| Shipping DB    |
+----------------+
Components
User
user
End user interacting with the system
API Gateway
api_gateway
Routes user requests to appropriate services
Order Service
service
Manages order domain logic and data
Payment Service
service
Manages payment domain logic and data
Shipping Service
service
Handles shipping domain logic and data
Order DB
database
Stores order data for Order Service
Payment DB
database
Stores payment data for Payment Service
Shipping DB
database
Stores shipping data for Shipping Service
Message Queue
message_queue
Enables asynchronous communication between services
Request Flow - 10 Hops
UserAPI Gateway
API GatewayOrder Service
Order ServiceOrder DB
Order ServiceMessage Queue
Message QueuePayment Service
Payment ServicePayment DB
Payment ServiceMessage Queue
Message QueueShipping Service
Shipping ServiceShipping DB
Shipping ServiceUser
Failure Scenario
Component Fails:Message Queue
Impact:Asynchronous communication between services stops; Payment and Shipping services do not receive events, causing delays and inconsistent state.
Mitigation:Implement message queue replication and persistence; use fallback retries and alerting to restore message flow quickly.
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for routing user requests to the correct service?
AMessage Queue
BAPI Gateway
COrder Service
DLoad Balancer
Design Principle
This architecture shows how bounded contexts separate domain logic and data into distinct microservices. Each service owns its data and communicates asynchronously to maintain loose coupling and scalability.