0
0
Microservicessystem_design~12 mins

Canary deployment in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Canary deployment

Canary deployment is a technique to release new software versions to a small subset of users first. This helps detect issues early without affecting all users. The system routes a small percentage of traffic to the new version while the rest use the stable version.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
Traffic Router (Canary Controller)
  /           \
 v             v
Service v1   Service v2 (Canary)
  |             |
  v             v
Database       Database
  |             |
Cache          Cache
Components
User
client
End user making requests
Load Balancer
load_balancer
Distributes incoming traffic evenly to Traffic Router
Traffic Router (Canary Controller)
service
Routes a small percentage of traffic to new version (canary) and rest to stable version
Service v1
service
Stable version of the microservice handling most user requests
Service v2 (Canary)
service
New version deployed to a small subset of users for testing
Database
database
Stores persistent data accessed by both service versions
Cache
cache
Speeds up data access for services
Request Flow - 18 Hops
UserLoad Balancer
Load BalancerTraffic Router (Canary Controller)
Traffic Router (Canary Controller)Service v2 (Canary)
Traffic Router (Canary Controller)Service v1
Service v1Cache
CacheService v1
Service v1Database
DatabaseService v1
Service v1Cache
Service v1Traffic Router (Canary Controller)
Service v2 (Canary)Cache
CacheService v2 (Canary)
Service v2 (Canary)Database
DatabaseService v2 (Canary)
Service v2 (Canary)Cache
Service v2 (Canary)Traffic Router (Canary Controller)
Traffic Router (Canary Controller)Load Balancer
Load BalancerUser
Failure Scenario
Component Fails:Traffic Router (Canary Controller)
Impact:Requests cannot be routed to either stable or canary services, causing service unavailability.
Mitigation:Use redundant Traffic Router instances with health checks and automatic failover to ensure routing continues without interruption.
Architecture Quiz - 3 Questions
Test your understanding
Which component decides what percentage of user requests go to the new version?
ALoad Balancer
BTraffic Router (Canary Controller)
CService v1
DCache
Design Principle
This architecture demonstrates safe software rollout by routing a small portion of traffic to a new version while keeping most users on the stable version. It uses a traffic router to control routing decisions and caching to reduce database load, ensuring minimal user impact during deployment.