0
0
Microservicessystem_design~12 mins

Chaos engineering basics in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Chaos engineering basics

Chaos engineering is about testing how a system behaves when parts fail unexpectedly. It helps find weaknesses before real problems happen. The system is designed with microservices that communicate through APIs, with monitoring and fallback mechanisms to keep services running during failures.

Architecture Diagram
          +------------+          +----------------+
          |            |          |                |
User --->| Load       |--------->| API Gateway    | 
          | Balancer   |          |                |
          +------------+          +----------------+
                                       |      
             +-------------------------+-------------------------+
             |                         |                         |
      +--------------+          +--------------+          +--------------+
      | Service A    |          | Service B    |          | Service C    |
      +--------------+          +--------------+          +--------------+
             |                         |                         |
      +--------------+          +--------------+          +--------------+
      | Database A   |          | Database B   |          | Database C   |
      +--------------+          +--------------+          +--------------+
             |                         |                         |
      +--------------+          +--------------+          +--------------+
      | Cache A      |          | Cache B      |          | Cache C      |
      +--------------+          +--------------+          +--------------+

Monitoring & Chaos Injector Service connected to API Gateway and Services
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Distributes incoming user requests evenly to API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate microservices and enforces security
Service A
service
Handles specific business logic and communicates with Database A and Cache A
Service B
service
Handles another business domain and communicates with Database B and Cache B
Service C
service
Handles additional business logic and communicates with Database C and Cache C
Database A
database
Stores persistent data for Service A
Database B
database
Stores persistent data for Service B
Database C
database
Stores persistent data for Service C
Cache A
cache
Speeds up data access for Service A by caching frequent queries
Cache B
cache
Speeds up data access for Service B by caching frequent queries
Cache C
cache
Speeds up data access for Service C by caching frequent queries
Monitoring & Chaos Injector Service
service
Monitors system health and injects failures to test system resilience
Request Flow - 13 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A
Service ACache A
Cache AService A
Service ADatabase A
Database AService A
Service ACache A
Service AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Monitoring & Chaos Injector ServiceService B
Service BMonitoring & Chaos Injector Service
Failure Scenario
Component Fails:Database B
Impact:Service B cannot read or write persistent data, causing errors or degraded functionality. Cache B may serve stale data but cannot update.
Mitigation:System detects failure via monitoring. Traffic to Service B can be rerouted or degraded gracefully. Database replication or failover can restore availability.
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for distributing user requests evenly to prevent overload?
AAPI Gateway
BLoad Balancer
CCache
DDatabase
Design Principle
This architecture demonstrates how chaos engineering integrates failure injection and monitoring into a microservices system. It uses caching to improve performance and load balancing to distribute traffic. The design ensures resilience by detecting failures early and enabling graceful degradation or recovery.