Gateway Aggregation Pattern

--

In this article, we are going to talk about Design Patterns of Microservices architecture which is The Gateway Aggregation 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 Gateway Aggregation 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.

Gateway Aggregation Pattern

Gateway Aggregation pattern is similar with Gateway Routing but extra it is offering aggregation of services. Basically Gateway Aggregation pattern offers to use a gateway service that provide to aggregate multiple internal requests to internal microservices with exposing a single request to the client.

This pattern is should be used if client application have to invoke several different backend microservices to perform its logic.
Lets look at the image;

If we can’t put aggregation box here, The client sends requests to each service. Each service processes the request and sends the response back to the application (2,3,4,5,6).

So this will cause network problems and latency. And its not good to manage direct access services from the client and not good to invoke service responsibility to client.

To solve this problems, we can use a gateway to reduce chattiness between the client and the internal microservices. The gateway receives client requests, and dispatches requests to the several backend services, and then aggregates the results and sends them back to the requesting client.

This pattern can reduce the number of requests that the application makes to backend services, and improve application performance over high-latency networks.

See image that UI and MS communication are direct, and it seems hard to manage communications. We now we should focus on microservices communications with applying API GW pattern and evolving these architecture step by step.

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.

--

--

Mehmet Ozkaya
Design Microservices Architecture with Patterns & Principles

Software Architect | Udemy Instructor | AWS Community Builder | Cloud-Native and Serverless Event-driven Microservices https://github.com/mehmetozkaya