Service Aggregator Pattern

In this article, we are going to talk about Design Patterns of Microservices architecture which is The Service Aggregator Pattern. As you know that we learned practices and patterns and add them into our design toolbox. And we will use these pattern and practices when designing microservice architecture.

By the end of the article, you will learn where and when to apply Service Aggregator Pattern into Microservices Architecture with designing e-commerce application system with following KISS, YAGNI, SoC and SOLID principles.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

Service Aggregator Pattern

In order to minimize service-to-service communications, we can apply Service Aggregator Pattern.

Basically, The Service aggregator design pattern is receives a request from the client or API Gateways, and than dispatches requests of multiple internal backend microservices, and than combines the results and responds back to the initiating request in 1 response structure.

By Service Aggregator Pattern implementation, we can reduces chattiness and communication overhead between the client and microservices.

Lets see the image, You can find here is AddItem Aggregator Microservice which basically orchestrates the AddItem into Shopping Cart operation. And it aggregates request to several back-end microservices which's are Product, Shopping Cart and Pricing.

So we can say that this pattern isolates the underlying AddItem operation that makes calls to multiple back-end microservices, centralizing its logic into a AddItem Aggregator Microservice.

Also we can apply this pattern into our e-commerce application architecture when querying data from backend systems.

Design — Service Aggregator Pattern — Service Registry Pattern — Microservices Communications Design patterns

You can find example implementation of Service Aggregator Pattern for our e-commerce architecture.

As you can see that we have applied Service Aggregator Pattern — Service Registry Pattern for our e-commerce architecture.

So we should evolve our architecture with applying new microservices patterns in order to accommodate business adaptations faster time-to-market and handle larger requests.

Step by Step Design Architectures w/ Course

I have just published a new course — Design Microservices Architecture with Patterns & Principles.

In this course, we’re going to learn how to Design Microservices Architecture with using Design Patterns, Principles and the Best Practices. We will start with designing Monolithic to Event-Driven Microservices step by step and together using the right architecture design patterns and techniques.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store