A Real-world Microservices Use Case — Part II

How to communicate among the microservices

Nadeeshaan Gunasinghe

--

In my previous post, I discussed how to define the problem statement and choose the right high-level architecture (e.g., Monolithic vs. Microservices). Now, let’s dive into inter-microservice communication in our bookstore application.

Communication Patterns in Microservices

When breaking an application into multiple microservices, selecting the appropriate communication pattern is crucial. In microservices architecture, two primary communication modes exist:

  1. Synchronous (Blocking) Communication
  2. Asynchronous (Non-blocking) Communication

Synchronous-blocking Communication

Synchronous communication is used when the client requires an immediate response, as opposed to waiting for an eventual one. One of the most common protocols for synchronous communication is HTTP, though others are frequently used, including:

  • gRPC
  • WebSocket
  • RMI (Remote Method Invocation)

--

--

Nadeeshaan Gunasinghe

Autor, Expert Software Engineer at Zuhlke Group - Singapore, Microservices Enthusiast, Full-stack Developer, Hardcore Cricket Fan, Sci-fi Addict ;)