Performance comparison of microservices written using reactive and imperative approaches

Kacper Mochniej

kacper.mochniej@pollub.edu.pl
Politechnika Lubelska (Poland)

Marcin Badurowicz


Lublin University of Technology (Poland)

Abstract

The purpose of this paper is to compare the performance of microservices based on reactive and imperative approaches. For this purpose, two microservice applications written in Java using the Spring programming framework were developed. The Spring Web and Spring Webflux modules were used for the conventional and reactive versions, respectively. During the tests, functionalities related to operations of retrieving and inserting records into the database, data processing, and file transfer were invoked. The Gatling tool was used to conduct the tests. The tests showed that reactive microservices can be more efficient in particular when there are delays in communication with services or the database. Otherwise, it depends on the complexity of the operations being performed. Microservices based on the reactive paradigm also use less RAM compared to conventional counterparts.


Keywords:

reactive programming, imperative programming, microservices

J. Thönes, Microservices, IEEE Software 32(1) (2015) 113-116.
DOI: https://doi.org/10.1109/MS.2015.11   Google Scholar

T. Nurkiewicz, B. Christensen, Reactive Programming with RxJava: Creating asynchronous, event based applications, 1st Edition, O’Reilly Media , 2016.
  Google Scholar

Spring WebFlux Documentation, https://docs.spring.io/spring-framework/reference/web/webflux.html#webflux, [27.05.2023].
  Google Scholar

Project Reactor webpage, https://projectreactor.io/, [27.05.2023].
  Google Scholar

P. Dakowitz, Comparing reactive and conventional programming of Java based microservices in containerized environments, Master thesis, Haw Hamburg, 2018.
  Google Scholar

S. Iwanowski, G. Kozieł, Comparative analysis of reactive and imperative approach in Java Web application development, Journal of Computer Sciences Institute 24 (2022) 242-249.
DOI: https://doi.org/10.35784/jcsi.2999   Google Scholar

K. Dahlin, An evaluation of Spring Webflux with focus on built in SQL features, Master thesis, Mid Sweden University, 2020.
  Google Scholar

A. Nordlund, N.Nordstrom, Reactive vs Non-reactive Java Framework, Bachelor thesis, Mid Sweden University, 2022.
  Google Scholar

A. Sim, O. Barus, F. Jaya, Lessons Learned In Applying Reactive System In Microservices, Journal of Physics: Conf. Series 1175 (2019) 1-6.
DOI: https://doi.org/10.1088/1742-6596/1175/1/012101   Google Scholar

G. Hochbergs, Reactive Programming and its effect on performance and the development process, Master thesis, Lund University, 2017.
  Google Scholar

J. Ferreira, Reactive Microservices An Experiment, Master thesis, Polytechnic of Porto, 2022.
  Google Scholar

Gatling webpage, https://gatling.io/ , [27.05.2023]
  Google Scholar

Download


Published
2023-09-30

Cited by

Mochniej, K., & Badurowicz, M. (2023). Performance comparison of microservices written using reactive and imperative approaches. Journal of Computer Sciences Institute, 28, 242–247. https://doi.org/10.35784/jcsi.3698

Authors

Kacper Mochniej 
kacper.mochniej@pollub.edu.pl
Politechnika Lubelska Poland

Authors

Marcin Badurowicz 

Lublin University of Technology Poland

Statistics

Abstract views: 150
PDF downloads: 173