By WalkingTree   November 20,  2020

Inter-service communication in Microservices

The goal of a microservices architecture is to sufficiently de-couple the application into loosely coupled services. The distributed micro-units collectively serve application purposes. Transactions spanning over multiple services become inevitable after breaking a single application into microservices. Then communication across microservices boundaries becomes challenging. Let’s take a look at how to handle communication & execution flow in microservices. 

Coordinating Inter-service Communication

Clients & services target different goals to communicate through different mechanisms. Depending upon the protocol, it can be synchronous or asynchronous. 

  • Synchronous Communication: A predefined source service address is required, and both services (caller and callee) should be up and running at the moment. Though Protocol may be synchronous, I/O operation can be asynchronous where the client need not necessarily wait for the response. The common request-response approach common to web API includes REST, GraphQL, and gRPC. 
  • Asynchronous Communication: In the case of asynchronous communication, callers need not have the specific destination of the callee. Handling multiple consumers at a time is relatively easy. Moreover, the message queues up if the receiving service is down & proceeds later when they are up. This is important from the POV of loose coupling and multi-service communication. 

Read on to know more about Communication and design patterns in a Microservices architecture.

Blogs

Translate »