Thursday, November 24, 2022

Microservices Design Patterns : Aggregator Pattern

When breaking the business functionality into several smaller logical pieces of code, it becomes necessary to think about how to collaborate data returned by each service. The aggregator pattern helps to address this problem. In this article we will further understand about the aggregator pattern.

The aggregator pattern, the aggregator component aggregates the data from different services and sends the final response to the consumer. The aggregation can be done by writing business logic as a composite microservice or at the API gateway. As seen in the following image, the "Aggregator" is responsible for calling different services one by one. If we need to apply any business logic over the results of the service A, B and C, then we can implement the business logic in the aggregator itself.


An aggregator can be again exposed as another service to the outer world, which can be consumed by others whenever required. 

No comments:

Post a Comment