STREAMLINING API DEVELOPMENT: A COMPARATIVE ANALYSIS OF GRAPHQL AND RESTFUL WEB SERVICES
Keywords:
REST API, GraphQL, Web ServicesAbstract
Modern data-driven apps place a premium on well-structured and efficient interaction with backend APIs. With its enhanced efficiency and greater adaptability, GraphQL quickly became a formidable contender to REST APIs. One of the most well-known GraphQL client libraries, Apollo Client, makes it even easier to communicate with GraphQL services. In order to improve the developer experience and code quality, this article explores how to use the Apollo Client's service models to create strongly typed representations of your GraphQL schema. An alternative to existing methods for dealing with issues related to data access and versioning in representational state transfer APIs, GraphQL is an execution engine and query language for online application programming interfaces (APIs). When it comes to creating or implementing API services, most middleware application developers can choose between two options: After that, you have the option to continue using REST or investigate the emerging GraphQL protocol. Most people agree that REST is the best way to build an API, but GraphQL is thought to be revolutionary because it fixes REST's biggest problems, especially with getting data. But there are still questions because no studies have created strong results when comparing how well the two programs work. Throughput, reaction time, CPU load, and memory consumption are some of the fundamental Quality of Service (QoS) measures that were utilized to examine the performance evaluation. We use the word efficiency to describe how the performance criteria used to compare the evaluations vary. A boxplot visualization was employed to demonstrate the significance of the comparing results, in addition to testing the statistical hypothesis parameters with the two-tails paired t-test. With a response time advantage of up to 50.50 percent and a throughput advantage of 37.16 percent, REST appears to be the quickest method. In contrast, GraphQL uses just 37.26% of the CPU and 39.54% of the memory, demonstrating its remarkable resource efficiency.
References
Brito, G.; Valente, M.T. REST vs GraphQL: A Controlled Experiment. In Proceedings of the 2020 IEEE International Conference on Software Architecture (ICSA), Salvador, Brazil, 16–20 March 2020; pp. 81–91. [Google Scholar]
Vadlamani, S.L.; Emdon, B.; Arts, J.; Baysal, O. Can GraphQL Replace REST? A Study of Their Efficiency and Viability. In Proceedings of the 2021 IEEE/ACM 8th International Workshop on Software Engineering Research and Industrial Practice (SER&IP), Madrid, Spain, 4 June 2021; pp. 10–17. [Google Scholar]
Eizinger, T. API Design in Distributed Systems: A Comparison between GraphQL and REST. Master’s Thesis, University of Applied Sciences Technikum Wien, Vienna, Austria, 4 May 2017. Available online: https://eizinger.io/assets/Master-Thesis.pdf (accessed on 9 March 2021).
Ghebremicael, E.S. Transformation of REST API to GraphQL for OpenTOSCA. Master’s Thesis, Universität Stuttgart, Stuttgart, Germany, 8 November 2017. [Google Scholar]
Fielding, R.T. Architectural Styles and the Design of Network-Based Software Architectures. Ph.D. Thesis, University California at Irvine, Irvine, CA, USA, 2000. Available online: https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf (accessed on 21 June 2021).
Lyu, S. REST APIs. In Practical Rust Web Projects, 1st ed.; Lyu, S., Ed.; Apress: Berkeley, CA, USA, 2021; pp. 55–102. [Google Scholar]
Ozdemir, E. A General Overview of RESTful Web Services. In Applications and Approaches to Object-Oriented Software Design: Emerging Research and Opportunities, 1st ed.; Altan, Z., Ed.; IGI Global: Hershey, PA, USA, 2020; pp. 133–165. [Google Scholar]
Facebook Inc. GraphQL Specification (Draft). Available online: http://spec.graphql.org/July2015/ (accessed on 9 March 2021).
Jamil, H.M. Design of declarative graph query languages: On the choice between value, pattern and object based representations for graphs. In Proceedings of the IEEE 28th International Conference on Data Engineering Workshops, Arlington, VA, USA, 1–5 April 2012; pp. 178–185. [Google Scholar]
Welch, N. An Introduction to GraphQL. In Proceedings of the SREcon19Americas, USENIX Association, Brooklyn, NY, USA, 25–27 March 2019; Available online: https://www.usenix.org/conference/srecon19americas/presentation/welch (accessed on 10 September 2021).
Byron, L. GraphQL: A Data Query Language. FACEBOOK Engineering, Core Data, Developer Tools. 2015. Available online: https://engineering.fb.com/2015/09/14/core-data/graphql-a-data-query-language/ (accessed on 9 March 2021).
Mikuła, M.; Dzieńkowski, M. Comparison of REST and GraphQL web technology performance. J. Comput. Sci. Inst. 2020, 16, 309–316. [Google Scholar] [CrossRef]
Seabra, M.; Nazário, M.F.; Pinto, G. REST or GraphQL? A Performance Comparative Study. In Proceedings of the ACM XIII Brazilian Symposium on Software Components, Architectures and Reuse (SBCARS), Salvador, Brazil, 23–27 September 2019; pp. 123–132. [Google Scholar]
Vesić, M.; Nenad Kojić, N. Comparative Analysis of Web Application Performance in Case of Using REST versus GraphQL. In Proceedings of the Fourth International Scientific Conference on Recent Advances in Information Technology, Tourism, Economics, Management and Agriculture (ITEMA), Online-Virtual, 8 October 2020; pp. 17–24. Available online: https://www.itema-conference.com/wp-content/uploads/2021/03/0_Itema-2020-Conference-Proceedings_Draft.pdf#page=23 (accessed on 21 June 2021).
Gustavsson, K.; Stenlund, E. Efficient Data Communication between a Webclient and a Cloud Environment. Master’s Thesis, Dept. Electrical and Info. Technology, Faculty of Engineering, LTH, Lund University, Lund, Sweden, 23 June 2016. Available online: https://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=8885754&fileOId=8885760
Gos, K., Zabierowski, W., 2020. The comparison of microservice and monolithic architecture. In: 2020 IEEE XVIth International Conference on the Perspective Technologies and Methods in MEMS Design. MEMSTECH, pp. 150–153.
Cerny, T., Donahoo, M.J., Pechanec, J., 2017. Disambiguation and comparison of SOA, microservices and self-contained systems. In: Proceedings of the International Conference on Research in Adaptive and Convergent Systems. RACS ’17, Association for Computing Machinery, New York, NY, USA, pp. 228–235. http://dx.doi.org/10. 1145/3129676.3129682
Bushong, V., Abdelfattah, A.S., Maruf, A.A., Das, D., Lehman, A., Jaroszewski, E., Coffey, M., Cerny, T., Frajtak, K., Tisnovsky, P., Bures, M., 2021. On microservice analysis and architecture evolution: A systematic mapping study. Appl. Sci. 11 (17), http://dx.doi.org/10.3390/app11177856, URL: https://www.mdpi.com/2076- 3417/11/17/7856.
Zhang, H., Li, S., Jia, Z., Zhong, C., Zhang, C., 2019. Microservice architecture in reality: An industrial inquiry. In: 2019 IEEE International Conference on Software Architecture. ICSA, pp. 51–60. http://dx.doi.org/10.1109/ICSA.2019.00014
Wu, M., Zhang, Y., Liu, J., Wang, S., Zhang, Z., Xia, X., Mao, X., 2022. On the way to microservices: Exploring problems and solutions from online Q&A community. In: 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering. SANER, pp. 432–443. http://dx.doi.org/10.1109/SANER53432. 2022.00058.
Ma, S.-P., Fan, C.-Y., Chuang, Y., Liu, I.-H., Lan, C.-W., 2019. Graph-based and scenariodriven microservice analysis, retrieval, and testing. Future Gener. Comput. Syst. 100, 724–735. http://dx.doi.org/10.1016/j.future.2019.05.048, URL: https://www. sciencedirect.com/science/article/pii/S0167739X19302614.
Söylemez, M., Tekinerdogan, B., Kolukısa Tarhan, A., 2022. Challenges and solution directions of microservice architectures: A systematic literature review. Appl. Sci. 12 (11), http://dx.doi.org/10.3390/app12115507, URL: https://www.mdpi.com/ 2076-3417/12/11/5507.
Zdun, U., Wittern, E., Leitner, P., 2020. Emerging trends, challenges, and experiences in DevOps and microservice APIs. IEEE Softw. 37 (1), 87–91. http://dx.doi.org/10. 1109/MS.2019.2947982.
Assunção, W.K., Krüger, J., Mosser, S., Selaoui, S., 2023. How do microservices evolve? An empirical analysis of changes in open-source microservice repositories. J. Syst. Softw. 204, 111788. http://dx.doi.org/10.1016/j.jss.2023.111788, URL: https://www.sciencedirect.com/science/article/pii/S0164121223001838
Lamothe, M., Guéhéneuc, Y.-G., Shang, W., 2021. A systematic review of API evolution literature. ACM Comput. Surv. 54 (8), http://dx.doi.org/10.1145/3470133.
Lercher, A., Glock, J., Macho, C., Pinzger, M., 2023. Microservice API evolution in practice: A study on strategies and challenges - replication package. http://dx.doi. org/10.5281/zenodo.8275798.
Downloads
Published
Issue
Section
License
Copyright (c) 2024 Sudeesh Goriparthi (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.