REST API performance comparison of web applications based on JavaScript programming frameworks

Marcin Grudniak

marcin.grudniak@pollub.edu.pl
Lublin University of Technlogy (Poland)

Mariusz Dzieńkowski


Lublin University of Technology

Abstract

The aim of the work was to compare two technologies for creating server applications based on the JavaScript programming language. For the purposes of the research, two test applications were created. The first one was built on the basis of the Express programming framework and the second one on the basis of the Hapi framework. The client part of both applications was prepared using the React library. The client and server parts communicated with each other by means of REST API – the universal HTTP interface. The client application sent requests to the server application which then performed basic operations on the MongoDB basis and returned the result. As part of the work, an experiment consisting of four scenarios was developed. In each scenario, a different type of data was taken into consideration: a string of characters, an array, an object and an array of objects. The research focused on the efficiency aspect – measuring the response time of requests during GET, POST, PUT and DELETE operations. The tests were performed on two computers and the measurements were made in two ways: using a single code embedded in test applications and using the Postman tool. The obtained results, after averaging and analyzing them allowed for the conclusion that the Express framework proved to be more efficient than Hapi due to the shorter response time of requests. Only in the scenario where operations with large datasets were performed was the response time of requests at a similar level.


Keywords:

Express, Hapi, performance analysis, response time of requests

M. Pilar Salas-Zarate, G. Alor-Hernandez, R. Valencia-Garcia, L. Rodriguez-Mazahua, A. Rodriguez-Gonzalez, J. L. Lopez Cuadro, Analyzing best practices on Web development frameworks: The lift approach, Science of Computer Programming, Science of Computer Programming, 102, 1-19, 2015, https://doi.org/10.1016/j.scico.2014.12.004, [16.03.2021].
DOI: https://doi.org/10.1016/j.scico.2014.12.004   Google Scholar

Mozilla Developer Network, Wprowadzenie do Express/Node, https://developer.mozilla.org/pl/docs/Learn/Server-side/Express_Nodejs/Introduction, [16.03.2021].
  Google Scholar

Offshore Web Developer, Hapi vs Express: Which NodeJS Frameworks is the Better?, http://www.offshorewebdeveloper.com/blog/hapi-vs-express/, [16.03.2021].
  Google Scholar

Stackoverflow.com, https://insights.stackoverflow.com/survey/2020#technology, [27.03.2021].
  Google Scholar

Github.com, https://github.com/showcases/web-application-frameworks, [27.03.2021].
  Google Scholar

Stateofjs, https://2020.stateofjs.com/en-US/technologies/back-end-frameworks/, [27.03.2021].
  Google Scholar

RapidAPI Blog, The Best NodeJS Frameworks for 2021, https://rapidapi.com/blog/best-nodejs-frameworks/, [25.03.2021].
  Google Scholar

Frameworks built on Express, https://expressjs.com/, https://expressjs.com/en/resources/frameworks.html, [25.03.2021].
  Google Scholar

S. Martin, Top 10 Node.js Frameworks For Web App Development in 2021, https://javascript.plainenglish.io/top-10-node-js-frameworks-for-web-app-development-in-2020-21-38e3ea2a57e5, [25.03.2021].
  Google Scholar

Npm trends, https://www.npmtrends.com/express-vs-hapi, [27.03.2021].
  Google Scholar

D. Swerski, Hapi vs. Express in 2019: Node.js framework comparison, https://raygun.com/blog/hapi-vs-express/, [26.10.2020].
  Google Scholar

Raygun, Node.js performance vs Hapi, Express, Restify, Koa & More, https://raygun.com/blog/nodejs-vs-hapi-express-restify-koa/, [26.10.2020].
  Google Scholar

B. Miłosierny, M. Dzieńkowski, The comparative analysis of web application frameworks in the Node.js ecosystem, Journal of Computer Science Institute, 18, 42-48, 2021, https://doi.org/10.35784/jcsi.2423, [30.03.2021].
DOI: https://doi.org/10.35784/jcsi.2423   Google Scholar

J. Brett, Getting Started with hapi.js, Packt Publishing, 2016.
  Google Scholar

E. M. Hahn, Express in action. Writing, building, and testing Node.js applications, Manning Publications Co., 2016.
  Google Scholar

M. Massé, REST API Design Rulebook, O’Reilly, 2012.
  Google Scholar

Postman, https://www.postman.com/, [27.03.2021].
  Google Scholar

Download


Published
2021-06-30

Cited by

Grudniak, M., & Dzieńkowski, M. (2021). REST API performance comparison of web applications based on JavaScript programming frameworks. Journal of Computer Sciences Institute, 19, 121–125. https://doi.org/10.35784/jcsi.2620

Authors

Marcin Grudniak 
marcin.grudniak@pollub.edu.pl
Lublin University of Technlogy Poland

Authors

Mariusz Dzieńkowski 

Lublin University of Technology

Statistics

Abstract views: 1193
PDF downloads: 783