REST or GraphQL? A Performance Comparative Study

  • Matheus Seabra UFPA
  • Marcos Felipe Nazário UFPA
  • Gustavo Pinto UFPA

Resumo


Given the variety of architectural models that can be used, a frequent questioning among software development practitioners is: which architectural model to use? To respond this question regarding performance issues, three target applications have been studied, each written using two models web services architectures: REST and GraphQL. Through research of performance metrics of response time and the average transfer rate between the requests, it was possible to deduce the particularities of each architectural model in terms of performance metrics. It was observed that migrating to GraphQL. resulted in an increase in performance in two-thirds of the tested applications, with respect to average number of requests per second and transfer rate of data. However, it was noticed that services after migration for GraphQL performed below its REST counterpart for workloads above 3000 requests, ranging from 98 to 2159 Kbytes per second after the migration study. On the other hand, for more trivial workloads, services on both REST and GraphQL architectures presented similar performances, where values between REST and GraphQL services ranged from 6.34 to 7.68 requests per second for workloads of 100 requests.
Palavras-chave: GraphQL, Modelo arquitetural, REST, Teste de desempenho
Publicado
23/09/2019
SEABRA, Matheus; NAZÁRIO, Marcos Felipe; PINTO, Gustavo. REST or GraphQL? A Performance Comparative Study. In: SIMPÓSIO BRASILEIRO DE COMPONENTES, ARQUITETURAS E REUTILIZAÇÃO DE SOFTWARE (SBCARS), 13. , 2019, Salvador/BA. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2019 . p. 123–132.