0
0
Microservicessystem_design~12 mins

Identifying service boundaries in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Identifying service boundaries

This system demonstrates how to divide a large application into smaller, independent microservices by identifying clear service boundaries. Each service handles a specific business capability, enabling easier development, deployment, and scaling.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +----------------+----------------+----------------+
  |                |                |
  v                v                v
Order Service   Inventory Service  Payment Service
  |                |                |
  v                v                v
Order DB       Inventory DB      Payment DB
  |
  v
Cache (Redis)
Components
User
client
End user interacting with the system
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate microservices based on URL and handles authentication
Order Service
service
Manages order creation, updates, and retrieval
Inventory Service
service
Manages product stock levels and availability
Payment Service
service
Handles payment processing and transaction status
Order DB
database
Stores order data for Order Service
Inventory DB
database
Stores inventory data for Inventory Service
Payment DB
database
Stores payment transaction data for Payment Service
Cache (Redis)
cache
Speeds up frequent reads for order data
Request Flow - 15 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayOrder Service
Order ServiceCache (Redis)
Cache (Redis)Order Service
Order ServiceOrder DB
Order ServiceInventory Service
Inventory ServiceInventory DB
Order ServicePayment Service
Payment ServicePayment DB
Payment ServiceOrder Service
Order ServiceCache (Redis)
Order ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Inventory Service
Impact:Stock updates fail, orders may be accepted without reducing inventory, causing overselling
Mitigation:Implement circuit breaker in Order Service to detect Inventory Service failure and reject orders or queue them for later processing
Architecture Quiz - 3 Questions
Test your understanding
Which component routes user requests to the correct microservice?
ACache
BAPI Gateway
CLoad Balancer
DDatabase
Design Principle
This architecture shows how to split a system into microservices by defining clear boundaries around business capabilities. Each service owns its own data and communicates asynchronously or synchronously with others, improving scalability and maintainability.