0
0
Microservicessystem_design~12 mins

Anti-patterns (distributed monolith, chatty services) in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Anti-patterns (distributed monolith, chatty services)

This system shows a microservices architecture suffering from two common anti-patterns: distributed monolith and chatty services. The services are tightly coupled and communicate excessively, causing high latency and poor scalability.

Key requirements include independent service deployment and efficient communication, which are violated here.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +-------------------+-------------------+
  |                   |                   |
Service A <---------> Service B <---------> Service C
  |                   |                   |
  +-------------------+-------------------+
          |                   |                   
          v                   v                   v
      Database A          Database B          Database C
          |                   |                   
          v                   v                   v
        Cache A             Cache B             Cache C
Components
User
user
End user initiating requests
Load Balancer
load_balancer
Distributes incoming requests to API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate microservices
Service A
service
Handles part of business logic but depends heavily on Service B and C
Service B
service
Handles another part of business logic, tightly coupled with Service A and C
Service C
service
Handles additional business logic, communicates frequently with Service A and B
Database A
database
Stores data for Service A
Database B
database
Stores data for Service B
Database C
database
Stores data for Service C
Cache A
cache
Caches data for Service A to reduce DB load
Cache B
cache
Caches data for Service B to reduce DB load
Cache C
cache
Caches data for Service C to reduce DB load
Request Flow - 19 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A
Service AService B
Service BService C
Service CCache C
Cache CService C
Service CDatabase C
Service CService B
Service BCache B
Cache BService B
Service BDatabase B
Service BService A
Service ACache A
Cache AService A
Service ADatabase A
Service AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Service B
Impact:Service A and C calls to Service B fail, causing request failures and increased latency. The tightly coupled calls cause cascading failures.
Mitigation:Decouple services by using asynchronous communication or event-driven patterns. Implement circuit breakers to isolate failures and degrade gracefully.
Architecture Quiz - 3 Questions
Test your understanding
Which anti-pattern is shown by the frequent synchronous calls between Service A, B, and C?
ACQRS pattern
BEvent-driven architecture
CChatty services
DBulkhead isolation
Design Principle
This architecture highlights the importance of designing microservices to be loosely coupled and communicate efficiently. Avoiding chatty services and distributed monoliths improves scalability, reliability, and independent deployability.