TECHNOLOGY

Microservices Communication Patterns

Microservices Communication Patterns

This block of templates covers how microservices interact externally: with client applications, remote services, and so on.

API Gateway Pattern

The most obvious way to access microservices is to go directly from the client to the service. And it is quite possible to apply it in small projects. However, for enterprise-scale applications with a large number of microservices, the API Gateway pattern is recommended.

This pattern is based on using a gateway that sits between the client application and microservices, providing a single entry point for the client.

Depending on the specific purpose of using the pattern, the following types of it are sometimes distinguished:

  • Gateway Routing: The gateway is used as a reverse proxy, redirecting client requests to the appropriate service.
  • Gateway Aggregation: The gateway is used to fork a client request across multiple microservices and return aggregated responses to the client.
  • Gateway Offloading: The gateway solves end-to-end tasks common to services: authentication, authorization, SSL, logging, and so on.

The use of the pattern reduces the number of calls, ensures client independence from the protocols used in services: REST, AMQP, gRPC, and so on, and provides centralized management of end-to-end functionality. However, a gateway can become a single point of failure, requires careful monitoring, and can be a bottleneck in the system in the absence of scaling.

Backends For Frontends (BFF) Template

This pattern is a variant of the API Gateway pattern implementation. It also provides an extra layer between microservices and clients. Still, instead of a single entry point, it introduces multiple gateways for each client type: Web, Mobile, Desktop, and so on.

Using the pattern, you can add APIs tailored to the needs of each client, eliminating the need to store a lot of unnecessary settings in one place. But the pattern should not be used in cases where the difference in API requirements for different types of clients is negligible or the application itself is tiny: this will only lead to code duplication and an increase in the number of components.

User Interface Design Patterns

This group of templates offers solutions for displaying data from multiple microservices on a single page or UI screen.

Client-Side UI Composition Template

Using this template, HTML markup is generated and updated directly in the browser. Each screen/page of the user interface is split into chunks, the data received by various microservices. Each such piece is essentially a mini-application that can display and update its markup independently of the rest of the page.

Many modern frameworks like AngularJS and ReactJS help in implementing this pattern. They use the principle of single-page applications (Single-Page Application, SPA), allowing you to update a specific area of ​​the screen rather than the entire page.

Server-Side Page Fragment Composition Template

With this template, UI snippets are assembled on the server, and the client-side receives a fully assembled page, resulting in faster loading times. The build is usually performed by a separate service between the browser and the application servers: Nginx, Varnish, CDN.

Also Read: Analogs Are Inappropriate: Why Officials Do Not Want To Buy Russian Computers

Technology Hunger

We, at Technology Hunger, publish and promote all the latest technology news and updates. We cover all the trending areas of technology and bring all the latest news for our viewers.

Recent Posts

Why Your Local ISP Provider Is The Best Choice For Reliable Service

In this digital age, where the internet is used in almost all aspects of life,…

1 day ago

Top Productivity Tools: The Next Generation 18 Best Productivity Apps For 2024

This digital age features the new next generation app breakthroughs which instantly emerge and metamorphose…

1 week ago

wellhealthorganic.com : Remove Dark Spots On Face Tang – Lemon Juice Step-By-Step Remedies

Description: Learn how to remove dark spots naturally using the tang of lemon juice. WellHealthOrganic.com…

1 week ago

How To Grow Car Dealerships On Instagram

When it comes to selling cars, there are many things that dealers can do to…

1 week ago

Debunking 5 Myths About Marketing Automation

Good day! Lyudmila is in touch; she is a marketer at Altcraft. Marketing automation will…

1 week ago

4 Tips On Finding The Right HR Tech For Your Business

Arguably, being part of your business' HR department means that you'll be doing a lot…

1 week ago