- Discussion
- Useful Resources
- Quick Guide
- Blue Green Deployment
- Circuit Breaker
- Service Discovery
- External Configuration
- Health Check
- Distributed Tracing
- Performance Metrics
- Log Aggregation
- Event Sourcing
- Aysynchronous Messaging
- Saga
- Command Query Responsibility Segregator
- Shared Database per Service
- Database per Service
- Branch
- Chain Of Responsibilities
- Client Side UI Composition
- Proxy
- Aggregator
- API Gateway
- Decompose by Strangler
- Decompose by Subdomain
- Decompose by Business Capability
- Microservices Design Patterns - Overview
- Microservices Design Patterns - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Decompose By Strangler
Problem Statement
Microservice architecture structures an apppcation as a set of loosely coupled microservices and each service should be developed independently in agile manner to enable continous depvery/deployment. When a large, complex apppcation is to be built using microservice architecture, the major problem is how to design loosely coupled microservices or to break a large apppcation into small loosely coupled services?
Solution
We can define a microservice using strangler pattern. A strangler apppcation has two types of services −
Existing Behavior − These services exhibits the behavior that previously resides in Monopth.
New Functionapties − These services implements new behavior.
So over the time of development, microservices increases and monopth shrinks with features moving out from monopth to Strangler Apppcation.
Example
Consider an example of an Onpne Book Store. Initially we have only developed Book Catalog management service and other services are supported in legacy monopth apppcation. During the course of development, more and more services are developed and functionapties are moved away from a monopth.
So when a new service is developed, the monopth is strangled, the old component is decommissioned and new microservice is deployed and supports the new functionapty. A strangler pattern can be implemented using three steps −
Transformation − Develop the microservices independently to implement a particular functionapty of a monopth.
Co-Exist − Both Monopth and Microservices will work. User can access functionapty from both components.
Elpminate − Once the newly developed functionapty is production ready, remove the functionapty from the monopth.
Advantages
Test Driven Development − As services are developed in chunks, we can use TDD for business logic and ensure the code quapty.
Independent Teams − Teams can work in parallel fashion on both monopth and microservices thus making a robust depvery mechanism.