A microservice ecosystem is essentially a distributed system that is running on multiple machines. Each service instance is just another process. We saw in the earlier diagram different process communications. In this section, we will learn about communication styles in much more detail.
A service consumer and service responder may communicate through many different types of communication styles, each one targeting some scenario and outcome in mind. The communication types can be categorized into two different aspects.
The first aspect deals with the type of protocol, whether it is synchronous or asynchronous:
- Communication invoked via commands and queries such as HTTP are synchronous in nature. The client sends a request to wait for a response from the service. This waiting is language-dependent, that is, it can be synchronous (languages such as Java) and it can be asynchronous (response can be processed via callbacks, promises, and so on, in our case, Node.js). The important...