Pattern: Command Query Responsibility Segregation (CQRS)
How to implement a query that retrieves data from multiple services in a microservice architecture?
Solution
Define a view database, which is a read-only replica that is designed to support that query. The application keeps the replica up to data by subscribing to Domain events published by the service that own the data.
Microservices Design Patterns - API Gateway
Main Objective
The purpose of the API Gateway is to represent a single point of entry to all those clients, and at the same time, to abstract the complexities of communication issues such as protocol transactions and data conversions.
The picture below highlights the API Gateway pattern in microservices architecture:
Benefits
The API gateway is a protocol-agnostic solution that serves distinct clients across several communication channels. It exposes each API for each consumer, according to the communication and client types, and embraces security once it is the main entry point. It abstracts any refactoring or break-down structures on existing systems (the so-called monoliths) to its clients, and abstracts underlying microservices topology and technologies involved to final consumers.
How to Implement It
Today the most popular available implementations to realize an API gateway solution are:
No comments:
Post a Comment