Benchmark: REST vs GraphQL vs gRPC Performance
DOI:
https://doi.org/10.63282/3050-922X.IJERET-V2I2P111Keywords:
REST, Graphql, Grpc, API Performance, Benchmarking, Latency, Payload Optimization, ScalabilityAbstract
This study provides a thorough performance comparison that assesses three commonly utilized API transmission protocols REST, GraphQL, along with Grpc against critical metrics that include latency, payload speed of throughput, and scalability. The purpose is for providing system architects and developers a meaningful understanding of how each system protocol works with different types of workloads and in what cases. The evaluation technique needed to establish environments for testing that were the same every time and were like real-world situations, like mobile app backends, API-heavy platforms, along with microservices communication. We employed applications like Postman, JMeter, k6, along with Wireshark to see how fast they responded, how effectively they responded to requests, how much time it was taking to serialize data, and how the internet connection performed. REST was the most popular and simple to understand protocol. It was more trustworthy, but it was slower and bigger given that it didn't keep track of state and made use of a lot of JSON. GraphQL worked well to cut down on data transmission by permitting these customers pick specific fields to use. This was fantastic for complicated front-end interactions as well as mobile apps, but it also implied that servers had to do more work. gRPC, and this leverages HTTP/2 and Protocol Buffers, exhibited less lag and more throughput than REST and GraphQL, especially in these tiny services and high-concurrency scenarios. This is because it is capable of receiving and sending data in both ways and retaining data in binary form. The results show that REST is an effective option for ease of use and consistency, but GraphQL is better to feed dynamic data demands, and gRPC is preferred by high-performance distributed apps. This benchmark helps you determine the best protocol for current software systems depending on which the program needs, how fast it has to be, and how significantly it needs to be able to develop.
References
[1] Seabra, Matheus, Marcos Felipe Nazário, and Gustavo Pinto. "Rest or graphql? A performance comparative study." Proceedings of the XIII Brazilian Symposium on Software Components, Architectures, and Reuse. 2019.
[2] Yellavula, Naren. Hands-On RESTful Web Services with Go: Develop Elegant RESTful APIs with Golang for Microservices and the Cloud. Packt Publishing Ltd, 2020.
[3] Eeda, Naresh. Rendering real-time dashboards using a GraphQL-based UI Architecture. MS thesis. The University of Western Ontario (Canada), 2017.
[4] Tu, Tengfei, et al. "Understanding real-world concurrency bugs in go." Proceedings of the twenty-fourth international conference on architectural support for programming languages and operating systems. 2019.
[5] Hunter II, Thomas. Distributed Systems with Node. js. O'Reilly Media, 2020.
[6] Vesić, Milena, and Nenad Kojić. "Comparative analysis of web application performance in case of using rest versus graphql." Proceedings of the Fourth International Scientific Conference on Recent Advances in Information Technology, Tourism, Economics, Management and Agriculture (ITEMA), Online-Virtual. 2020.
[7] Helgason, Arnar Freyr. "Performance analysis of Web Services: Comparison between RESTful & GraphQL web services." (2017).
[8] Indrasiri, Kasun, and Danesh Kuruppu. gRPC: up and running: building cloud native applications with Go and Java for Docker and Kubernetes. O'Reilly Media, 2020.
[9] Gerlinghoff, Florian. "Vergleich von Introspected REST mit alternativen Ansätzen für die Entwicklung von Web-APIs hinsichtlich Performance, Evolvierbarkeit und Komplexität." (2020).
[10] Yellavula, Naren. Hands-On RESTful Web Services with Go: Develop Elegant RESTful APIs with Golang for Microservices and the Cloud. Packt Publishing Ltd, 2020.
[11] Eeda, Naresh. Rendering real-time dashboards using a GraphQL-based UI Architecture. MS thesis. The University of Western Ontario (Canada), 2017.
[12] Parakala, Adityamallikarjunkumar. "Building Analytics-Driven Bots: RPA Meets Business Intelligence." International Journal of Emerging Research in Engineering and Technology 2.1 (2021): 77-87.
[13] Touronen, Ville. "Microservice architecture patterns with GraphQL." University of Helsinki (2019).
[14] Galambos, Péter. "Cloud, fog, and mist computing: Advanced robot applications." IEEE Systems, Man, and Cybernetics Magazine 6.1 (2020): 41-45.
[15] Wein, Stephan, et al. "Flexible and lightweight framework for active industrial asset administration shells." 2020 IEEE Conference on Industrial Cyberphysical Systems (ICPS). Vol. 1. IEEE, 2020.
[16] Gunawan, Go Frendi, and Jozua Ferjanus Palandi. "Redesigning CHIML: Orchestration Language for Chimera-Framework." 2018 Third International Conference on Informatics and Computing (ICIC). IEEE, 2018.
[17] Padala, S. (2019). AWS Cloud Architecture for Scalable Healthcare Contact Centers. American International Journal of Computer Science and Technology, 1(2), 21-26