0
0
Microservicessystem_design~12 mins

Blue-green deployment in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Blue-green deployment

Blue-green deployment is a technique to release new versions of software with minimal downtime and risk. It uses two identical environments (blue and green) where one serves live traffic while the other is updated. After testing the new version in the idle environment, traffic switches to it instantly.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  +-------------------+
  |                   |
Blue Environment   Green Environment
(Service v1)       (Service v2)
  |                   |
Database (shared)
  |
Cache
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Routes user requests to either blue or green environment
Blue Environment
service
Current live version of the service handling requests
Green Environment
service
New version of the service deployed and tested before switching
Database
database
Stores persistent data shared by both environments
Cache
cache
Speeds up data access for both environments
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerBlue Environment
Blue EnvironmentCache
CacheBlue Environment
Blue EnvironmentDatabase
DatabaseBlue Environment
Blue EnvironmentCache
Blue EnvironmentLoad Balancer
Load BalancerUser
DevOpsGreen Environment
Load BalancerGreen Environment
Failure Scenario
Component Fails:Load Balancer
Impact:All user requests fail as traffic cannot be routed to any environment
Mitigation:Use multiple load balancers with failover and health checks to avoid single point of failure
Architecture Quiz - 3 Questions
Test your understanding
Which component directs user traffic to either the blue or green environment?
ACache
BLoad Balancer
CDatabase
DUser
Design Principle
Blue-green deployment uses two identical environments to reduce downtime and risk during software updates. Traffic switches instantly between environments via a load balancer, allowing safe testing and rollback. Shared database and cache ensure data consistency across versions.