Here’s how I always explain the need for async communication as well as sync communication in distributed systems.
There’re 2 possibilities when services talk together:
- One service ask something to another service.
- One service tell something to another service.
The “ask pattern” correspond to the sync communication protocol.
Your service need to get an information that is handled by another service. It just asks to this service. If the service is down, it could be considered as a negative answer.
The “tell pattern” correspond to the async communication protocol.
Your service need to tell something to an other service and this information should not be lost.
The sync communication is not usable here because if the service that receive the information is down, the information will be lost.
You can mitigate the problem with some retries but how many retry will you do ? What if the service never goes up again ?
So here, sync communication is not a viable solution.
We need to pass through an async communication protocol: a highly available message passing system (Kafka by default in Lagom, for example).
Now, you should understand when you should use sync or async communication between your services.
The last thing you need to understand is distributed transactions.
Distributed transactions are the nightmares of distributed systems developers.
You should know them in order to avoid them !
I’ll not explain you here what are distributed transactions but here is a good blog article about them and about how to work around them: http://www.grahamlea.com/2016/08/distributed-transactions-microservices-icebergs/
I hope I answered to some of your questions.