Let's face it – your microservices will, sooner or later, communicate with each other. In this section, we will explore when they should communicate and what should be communicated. The cases in which microservices can communicate with each other can be limited to the following cases:
- Data verification
- Data processing
- Data aggregation
- Data management
Notice that they all start with Data? That is actually an important hint: microservices usually only communicate with each other for internal purposes. This means that the request that is sent from one service to another almost never happens synchronously with a user request but rather through internal jobs, such as cron jobs.
For example, let's say we want to verify some user input, such as an order. The order contains products, and those products have prices. Of course, we want...