Asynchronous communication of microservices

Authors

  • Gerasymov Volodymyr
  • Druzhynin Denys

DOI:

https://doi.org/10.34185/1562-9945-1-144-2023-13

Keywords:

microservice, asynchronous communication, message broker, message queue, pub-lish/subscribe, HTTP, AMQP, Kafka, Scala, RabbitMQ.

Abstract

More and more business projects use microservice architecture, where large scale and long evolution of the project with the involvement of many developers are expected. This is due to the flexibility of scaling, the possibility of continuous deployment, ease of maintenance, and different teams can work on services without affecting the work pro-cesses as a whole, which is impossible with other architectural styles. Since micro-services are a complex structure consisting of independently designed and deployed ser-vices, communication between them can become a bottleneck, so we must be careful when considering asynchronous communication tools. The most popular open-source tools for asynchronous communication between RabbitMQ and Kafka services are considered. Although RabbitMQ and Kafka are some-times used interchangeably, their implementations are very different from each other. As a result, we cannot consider them as members of the same instrument category; one is a message broker, and the other is a distributed streaming platform. RabbitMQ is best used when we need: advanced and flexible routing rules, mes-sage timing control (managing message expiration or message delay). Advanced fault handling capabilities in cases where consumers are likely to be unable to process mes-sages (temporarily or permanently), simple implementations for consumers. Kafka is used when strict ordering of messages is required, the storage of messages for long periods of time, including the ability to replay past messages, and the ability to achieve high scale when traditional solutions are insufficient. We can implement most use cases using both platforms. However, the project ar-chitect must choose the most appropriate tool for the job. In making this choice, we must consider differences, as noted above. In other cases, when developing complex software systems, it may be tempting to implement all of the necessary messaging use cases using one platform when there are many advantages to using both platforms.

References

Karabey Aksakalli, Işıl; Çelik, Turgay; Can, Ahmet Burak; Teki̇nerdoğan, Bedir. Deployment and communication patterns in microservice architectures : A systemat-ic literature review. The Journal of Systems & Software. Volume 180, October 2021, 111014. DOI: https://doi.org/10.1016/j.jss.2021.111014

Benyamin Shafabakhsha, Robert Lagerströmb and Simon Hacksb. Evaluating the Impact of Inter Process Communication in Microservice Architectures. 8th Interna-tional Workshop on Quantitative Approaches to Software Quality (QuASoQ 2020). URL: https://ceur-ws.org/Vol-2767/07-QuASoQ-2020.pdf

Design interservice communication for microservices.

URL: https://learn.microsoft.com/en-us/azure/architecture/microservices/design/interservice-communication

Communication in a microservice architecture.

URL: https://learn.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/communication-in-microservice-architecture

Mehmet Ozkaya. Microservices Communications. URL: https://medium.com/design-microservices-architecture-with-patterns/microservices-communications-f319f8d76b71

Apache Kafka. URL: https://kafka.apache.org

Apache ZooKeeper. URL: https://zookeeper.apache.org

Messaging that just works — RabbitMQ. URL: https://www.rabbitmq.com"

Published

2023-05-11