0
0
Microservicessystem_design~12 mins

Service decomposition strategies in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Service decomposition strategies

This system explains how a large application is broken down into smaller, independent services called microservices. Each service handles a specific business function. The goal is to improve scalability, maintainability, and team autonomy.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +---------------------------+---------------------------+---------------------------+
  |                           |                           |
  v                           v                           v
User Service             Order Service               Payment Service
  |                           |                           |
  v                           v                           v
User Database           Order Database             Payment Database
  \
   \-> Cache Layer (shared or per service)
Components
User
actor
End user who interacts with the system
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Single entry point that routes requests to appropriate microservices
User Service
service
Handles user-related operations like registration and profile management
Order Service
service
Manages order creation, updates, and tracking
Payment Service
service
Processes payments and manages billing
User Database
database
Stores user data for User Service
Order Database
database
Stores order data for Order Service
Payment Database
database
Stores payment data for Payment Service
Cache Layer
cache
Speeds up data access by storing frequently used data temporarily
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayUser Service
User ServiceCache Layer
Cache LayerUser Service
User ServiceUser Database
User DatabaseUser Service
User ServiceCache Layer
User ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:User Database
Impact:User Service cannot retrieve or store user data, causing failures in user operations. Cache may still serve stale data for reads.
Mitigation:Use database replication for failover. Cache serves stale data temporarily. Alert system triggers for manual intervention.
Architecture Quiz - 3 Questions
Test your understanding
Which component directs user requests to the correct microservice?
ALoad Balancer
BCache Layer
CAPI Gateway
DUser Database
Design Principle
This architecture shows how breaking a large system into focused microservices improves scalability and team independence. Using an API Gateway centralizes routing, while caches reduce database load and improve response times.