0
0
Microservicessystem_design~12 mins

Database decomposition strategy in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Database decomposition strategy

This system demonstrates how a large monolithic database is split into smaller, service-specific databases to support a microservices architecture. Each microservice owns its own database, improving scalability, fault isolation, and development speed.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +----------------+----------------+----------------+----------------+
  |                |                |                |                |
Service A       Service B        Service C        Service D
  |                |                |                |
DB A             DB B             DB C             DB D
  |                |                |                |
Cache A          Cache B          Cache C          Cache D
Components
User
client
End user interacting with the system
Load Balancer
load_balancer
Distributes incoming requests evenly across API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate microservices
Service A
service
Handles business logic for domain A
Service B
service
Handles business logic for domain B
Service C
service
Handles business logic for domain C
Service D
service
Handles business logic for domain D
DB A
database
Stores data specific to Service A
DB B
database
Stores data specific to Service B
DB C
database
Stores data specific to Service C
DB D
database
Stores data specific to Service D
Cache A
cache
Speeds up read operations for Service A
Cache B
cache
Speeds up read operations for Service B
Cache C
cache
Speeds up read operations for Service C
Cache D
cache
Speeds up read operations for Service D
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A
Service ACache A
Cache AService A
Service ADB A
DB AService A
Service ACache A
Service AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:DB A
Impact:Service A cannot write or read fresh data; cache may serve stale data
Mitigation:Use database replication for failover; cache serves stale reads; alert and fallback mechanisms in Service A
Architecture Quiz - 3 Questions
Test your understanding
Which component routes user requests to the correct microservice?
AAPI Gateway
BLoad Balancer
CCache
DDatabase
Design Principle
This design shows database decomposition by assigning each microservice its own database and cache. This improves scalability, fault isolation, and allows teams to develop independently. The API Gateway and Load Balancer ensure requests are routed correctly and balanced across instances.