Synchronous and asynchronous communication
Our microservices need to communicate from time to time. The type of communication that we employ is based on the type of operation that we need to complete in the end. Synchronous communication means that one service will directly call another and wait for a response. It will then use this response to inform the process it sought to complete. This approach is ideal for situations where one service might have some data and needs the rest from another. For instance, the appointment booking service knows the patient’s ID number but has no other information. It will then need to make a synchronous API call to the patients’ service and GET the patient’s details. It can then carry one to process those details as necessary.
Synchronous communication is great when we need instant feedback from another service. Still, it can introduce issues and increase response time when several other services must be consulted. We also run...