Communication and data serialization
As explained in the Microservices design principles subsection of Chapter 5, Applying a Microservice Architecture to Your Enterprise Application, requests to a microservices-based application can’t cause long chains of recursive microservices calls. In fact, each call adds both a wait time and a communication time to the actual processing time, thus leading to unacceptable levels of overall response time, as shown in the figure below.
Figure 14.1: Tree of blocking RPC calls
Messages 1-6 are triggered by a request to the A microservice and are sent in sequence, so their processing times sum up to the response time. Moreover, once sent, message 1 from microservice A remains blocked till it receives the last message (6); that is, it remains blocked for the whole lifetime of the overall recursive communication process.
Microservice B remains blocked twice, the first time during the 2-3 communication and then during the 4-5...