0
0
Microservicessystem_design~12 mins

Traffic management (routing, splitting) in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Traffic management (routing, splitting)

This system manages how user requests are directed to different microservices. It supports routing requests based on rules and splitting traffic between service versions for testing or gradual rollouts. The goal is to ensure smooth user experience and safe deployment of new features.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +-------------------+
  |                   |
  v                   v
Service A v1       Service A v2
  |                   |
  v                   v
Database             Database
  |
  v
Cache
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Distributes incoming traffic evenly across API Gateway instances
API Gateway
api_gateway
Routes and splits traffic to different microservice versions based on rules
Service A v1
service
Handles requests for the stable version of Service A
Service A v2
service
Handles requests for the new version of Service A for testing or rollout
Database
database
Stores persistent data for Service A
Cache
cache
Speeds up data retrieval by storing frequently accessed data
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A v1 or Service A v2
Service A v1 or Service A v2Cache
CacheService A v1 or Service A v2
Service A v1 or Service A v2Database
DatabaseService A v1 or Service A v2
Service A v1 or Service A v2Cache
Service A v1 or Service A v2API Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:API Gateway
Impact:Requests cannot be routed or split, causing service unavailability
Mitigation:Deploy multiple API Gateway instances with health checks and failover; use load balancer to redirect traffic
Architecture Quiz - 3 Questions
Test your understanding
Which component decides how to split traffic between Service A versions?
ALoad Balancer
BAPI Gateway
CCache
DDatabase
Design Principle
This architecture demonstrates how traffic management uses an API Gateway to route and split requests between different service versions, enabling controlled rollouts and testing. The Load Balancer ensures availability and scalability by distributing incoming requests. Caching improves performance by reducing database load.