1.

What should be preferred communication style in microservices: synchronous or asynchronous?

Answer»
  1. You must use asynchronous communication while handling HTTP POST/PUT (anything that modifies the data) requests, using some reliable queue mechanism (RabbitMQ, AMQP, etc.) 
  2. It's fine to use SYNCHRONOUS communication for Aggregation pattern at API Gateway Level. But this aggregation should not include any business logic other than aggregation. Data VALUES must not be transformed at Aggregator, otherwise, it DEFEATS the purpose of Bounded Context. In Asynchronous communication, events should be published into a Queue. Events contain data about the domain, it should not tell what to do (action) on this data. 
  3. If MICROSERVICE to microservice communication still requires synchronous communication for GET operation, then seriously reconsider the partitioning of your microservices for bounded context, and create some TASKS in backlog/technical debt.


Discussion

No Comment Found