REDUCING UNDER-FETCHING AND OVER-FETCHING IN REST API WITH GRAPHQL FOR WEB-BASED SOFTWARE DEVELOPMENT

  • Rizki Nuzul Muzaki Study Program in Informatics Engineering, Faculty of Computer Science, Universitas Dian Nuswantoro, Semarang, Indonesia
  • Abu Salam Study Program in Informatics Engineering, Faculty of Computer Science, Universitas Dian Nuswantoro, Semarang, Indonesia
Keywords: GraphQL, Over-fetching, Rest API, Under-fetching

Abstract

Rest API is the most popular architectural style in website-based software development. However, Rest API has under-fetching and over-fetching problems. Under-fetching is a situation when the client has to make requests to several endpoints, while over-fetching is a situation when the client receives more data than needed. There is an alternative technology to Rest API, namely GraphQL. GraphQL has the potential to solve both under-fetching and over-fetching problems. This research aims to analyze how quickly GraphQL responds in overcoming under-fetching and over-fetching problems and conducting condition analysis to determine when it is best to use GraphQL. In this research, tests were conducted to answer these problems by applying each of the five test scenarios for under-fetching and over-fetching problems. Test results show that GraphQL can provide response speeds of 36.84% to 93.04% superior to Rest API. In the case of under-fetching, it is best to choose GraphQL when there is a need to call more than four endpoints. Meanwhile, for over-fetching problems, using the Rest API provides adequate response speed. However, if a more optimal response speed is needed, using GraphQL could be an alternative.

Downloads

Download data is not yet available.

References

P. Roksela, M. Konieczny, and S. Zielinski, “Evaluating execution strategies of GraphQL queries,” in 2020 43rd International Conference on Telecommunications and Signal Processing (TSP), Milan, Italy: IEEE, Jul. 2020, pp. 640–644. doi: 10.1109/TSP49548.2020.9163501.

A. Lawi, B. L. E. Panggabean, and T. Yoshida, “Evaluating GraphQL and REST API Services Performance in a Massive and Intensive Accessible Information System,” Computers, vol. 10, no. 11, p. 138, Oct. 2021, doi: 10.3390/computers10110138.

I. Kurniawan, Humaira, and F. Rozi, “REST API Menggunakan NodeJS pada Aplikasi Transaksi Jasa Elektronik Berbasis Android,” jitsi, vol. 1, no. 4, pp. 127–132, Dec. 2020, doi: 10.30630/jitsi.1.4.18.

A. Neumann, N. Laranjeiro, and J. Bernardino, “An Analysis of Public REST Web Service APIs,” IEEE Trans. Serv. Comput., vol. 14, no. 4, pp. 957–970, Jul. 2021, doi: 10.1109/TSC.2018.2847344.

S. K. Mukhiya, F. Rabbi, V. K. I Pun, A. Rutle, and Y. Lamo, “A GraphQL approach to Healthcare Information Exchange with HL7 FHIR,” Procedia Computer Science, vol. 160, pp. 338–345, 2019, doi: 10.1016/j.procs.2019.11.082.

A. Quiña-Mera, P. Fernandez, J. M. García, and A. Ruiz-Cortés, “GraphQL: A Systematic Mapping Study,” ACM Comput. Surv., vol. 55, no. 10, pp. 1–35, Oct. 2023, doi: 10.1145/3561818.

M. Vogel, S. Weber, and C. Zirpins, “Experiences on Migrating RESTful Web Services to GraphQL,” in Service-Oriented Computing – ICSOC 2017 Workshops, vol. 10797, L. Braubach, J. M. Murillo, N. Kaviani, M. Lama, L. Burgueño, N. Moha, and M. Oriol, Eds., in Lecture Notes in Computer Science, vol. 10797. , Cham: Springer International Publishing, 2018, pp. 283–295. doi: 10.1007/978-3-319-91764-1_23.

Facebook, “GraphQL.” Accessed: Dec. 12, 2023. [Online]. Available: https://spec.graphql.org/October2021/

R. Taelman, M. V. Sande, and R. Verborgh, “GraphQL­LD: Linked Data Querying with GraphQL,” Proceedings of the 17th International Semantic Web Conference: Posters and Demos, 2018.

D. H. Tinambunan, A. Baehaqi, R. P. Avrianto, and R. E. Indrajit, “MICROGEN IMPLEMENTATION FOR BUILDING ONLINE LEARNING MANAGEMENT SYSTEM WITH MICROSERVICES AND GRAPHQL GENERATOR APPROACH,” Jurnal Teknik Informatika (Jutif), vol. 4, no. 4, pp. 967–976, Aug. 2023.

O. Hartig and J. Pérez, “Semantics and Complexity of GraphQL,” in Proceedings of the 2018 World Wide Web Conference on World Wide Web - WWW ’18, Lyon, France: ACM Press, 2018, pp. 1155–1164. doi: 10.1145/3178876.3186014.

M. Bryant, “GraphQL for archival metadata: An overview of the EHRI GraphQL API,” in 2017 IEEE International Conference on Big Data (Big Data), Boston, MA: IEEE, Dec. 2017, pp. 2225–2230. doi: 10.1109/BigData.2017.8258173.

F. Hanif, I. Ahmad, and D. Darwis, “ANALISA PERBANDINGAN METODE GRAPHQL API DAN REST API DENGAN MENGGUNAKAN ASP.NET CORE WEB API FRAMEWORK,” vol. 3, no. 2, 2022.

A. T. Firdausi, D. S. Hormansyah, and F. Ervansyah, “IMPLEMENTASI GRAPHQL UNTUK MENGATASI UNDER- FETCHING PADA PENGEMBANGAN SISTEM INFORMASI PELACAKAN ALUMNI POLITEKNIK NEGERI MALANG,” vol. 7, 2021.

G. Brito, T. Mombach, and M. T. Valente, “Migrating to GraphQL: A Practical Assessment,” in 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), Hangzhou, China: IEEE, Feb. 2019, pp. 140–150. doi: 10.1109/SANER.2019.8667986.

G. Brito and M. T. Valente, “REST vs GraphQL: A Controlled Experiment,” in 2020 IEEE International Conference on Software Architecture (ICSA), Salvador, Brazil: IEEE, Mar. 2020, pp. 81–91. doi: 10.1109/ICSA47634.2020.00016.

K. S. Alim, N. A. Ekowati, R. Y. Kisworini, and L. Riyandari, “DESIGN AND DEVELOPMENT OF WEB-BASED APPLICATION CANGKINGAN USING SCRUM METHOD,” J. Tek. Inform. (JUTIF), vol. 4, no. 4, pp. 953–965, Aug. 2023, doi: 10.52436/1.jutif.2023.4.4.1311.

Published
2024-04-04
How to Cite
[1]
R. N. Muzaki and A. Salam, “REDUCING UNDER-FETCHING AND OVER-FETCHING IN REST API WITH GRAPHQL FOR WEB-BASED SOFTWARE DEVELOPMENT ”, J. Tek. Inform. (JUTIF), vol. 5, no. 2, pp. 447-453, Apr. 2024.