
- Microservices Design Patterns Tutorial
- Microservices Design Patterns - Home
- Microservices Design Patterns - Overview
- Decomposition Design Patterns
- Decompose by Business Capability
- Decompose by Subdomain
- Decompose by Strangler
- Integration Design Patterns
- API Gateway
- Aggregator
- Proxy
- Client Side UI Composition
- Chain Of Responsibilities
- Branch
- Database Design Patterns
- Database per Service
- Shared Database per Service
- Command Query Responsibility Segregator
- Saga
- Aysynchronous Messaging
- Event Sourcing
- Observability Design Patterns
- Log Aggregation
- Performance Metrics
- Distributed Tracing
- Health Check
- Cross Cutting Concern Design Patterns
- External Configuration
- Service Discovery
- Circuit Breaker
- Blue Green Deployment
- Useful Resources
- Quick Guide
- Useful Resources
- Discussion
Blue Green Deployment
Problem Statement
Microservice architecture structures an application as a set of loosely coupled microservices and each service should be developed independently in agile manner to enable continous delivery/deployment. When a large, complex application is to be built using microservice architecture, the major problem is how to design loosely coupled microservices or to break a large application into small loosely coupled services while keeping both the system in production.
Solution
We can define deploy newly development microservices using blue-green deployment. In this model, user traffic is diverted from old application to new microservice application gradually. One a microservice is available in production, the load balancer redirects the request targetted for old application to the new microservice.
Blue Environment − The old application running in the production is called blue environment.
Green Environment − The new services deployed which replicates the given part of old application is called the green environment.
So over the time of development, microservices increases and monolith shrinks with features moving out from monolith to microservices Application.
Example
Consider an example of an Online Book Store. Initially we have only developed Book Catalog managment service and other services are supported in legacy monolith application. During the course of development, more and more services are developed and functionalities are moved away from a monolith.

This mode of deployment helps in reducing the downtime or even zero downtime while migrating from a monolith to microservices based application.