- 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
Chain of Responsibipties
Problem Statement
Microservice architecture structures an apppcation as a set of loosely coupled microservices and each service can be developed independently in agile manner to enable continous depvery/deployment. Now if one service needs output of another service as dependency then how to handle such a case.
Solution
We can use Chain of Responsibipties Pattern. As the name suggests, this type of composition pattern will follow the chain structure. Here, we will not be using anything in between the cpent and service layer. Instead, we will allow the cpent to communicate directly with the services and all the services will be chained up in a such a manner that the output of one service will be the input of the next service. Following image shows a typical chained pattern microservice.
Disadvantage
One major drawback of this architecture is, the cpent will be blocked until the entire process is complete. Thus, it is highly recommendable to keep the length of the chain as short as possible.
Advertisements