Srinivas Vadlamani, Benjamin Emdon, Joshua Arts, Olga Baysal
{"title":"Can GraphQL Replace REST? A Study of Their Efficiency and Viability","authors":"Srinivas Vadlamani, Benjamin Emdon, Joshua Arts, Olga Baysal","doi":"10.1109/SER-IP52554.2021.00009","DOIUrl":null,"url":null,"abstract":"Representational State Transfer (REST) has traditionally been the standard web service architectural style for API creation. However, its popularity has been challenged with the introduction of GraphQL, an open source query language for APIs introduced by Facebook, in 2015. The latter has been quickly adopted by GitHub, Shopify, Airbnb, Twitter and more online portals are joining the list. In some instances, GraphQL has been adopted as an alternative architectural style or has been used in conjunction with REST.While GraphQL promises a considerable improvement over REST, much remains unexplored with respect to its efficiency and feasibility in its application. The goal of this paper is to determine viability of using GraphQL over REST for API architecture from quantitative and qualitative perspectives. A custom API client on GitHub is constructed to check on the response times and the corresponding magnitude of difference between REST and GraphQL. Thereafter, the paper surveyed employees of GitHub to understand software developers’ educated opinion and perceptions about REST and GraphQL based on their practical experience with APIs. The results show that both API paradigms have their benefits and weaknesses, and one cannot replace the other, at least in the near future.","PeriodicalId":259488,"journal":{"name":"2021 IEEE/ACM 8th International Workshop on Software Engineering Research and Industrial Practice (SER&IP)","volume":"43 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE/ACM 8th International Workshop on Software Engineering Research and Industrial Practice (SER&IP)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SER-IP52554.2021.00009","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5
Abstract
Representational State Transfer (REST) has traditionally been the standard web service architectural style for API creation. However, its popularity has been challenged with the introduction of GraphQL, an open source query language for APIs introduced by Facebook, in 2015. The latter has been quickly adopted by GitHub, Shopify, Airbnb, Twitter and more online portals are joining the list. In some instances, GraphQL has been adopted as an alternative architectural style or has been used in conjunction with REST.While GraphQL promises a considerable improvement over REST, much remains unexplored with respect to its efficiency and feasibility in its application. The goal of this paper is to determine viability of using GraphQL over REST for API architecture from quantitative and qualitative perspectives. A custom API client on GitHub is constructed to check on the response times and the corresponding magnitude of difference between REST and GraphQL. Thereafter, the paper surveyed employees of GitHub to understand software developers’ educated opinion and perceptions about REST and GraphQL based on their practical experience with APIs. The results show that both API paradigms have their benefits and weaknesses, and one cannot replace the other, at least in the near future.
代表性状态传输(Representational State Transfer, REST)传统上一直是API创建的标准web服务体系结构风格。然而,它的流行受到了GraphQL的挑战,GraphQL是Facebook在2015年推出的一种开源api查询语言。后者已迅速被GitHub、Shopify、Airbnb、Twitter和更多的在线门户网站所采用。在某些情况下,GraphQL被采用为一种可选的体系结构风格,或者与REST结合使用。虽然GraphQL承诺在REST上有相当大的改进,但在其应用程序的效率和可行性方面仍有许多有待探索的地方。本文的目标是从定量和定性的角度确定在API架构中使用基于REST的GraphQL的可行性。在GitHub上构建了一个自定义API客户端,用于检查REST和GraphQL之间的响应时间和相应的差异大小。之后,本文对GitHub的员工进行了调查,了解软件开发人员对REST和GraphQL的教育观点和看法,以及他们对api的实际经验。结果表明,这两种API范式各有优缺点,至少在不久的将来,一种API范式无法取代另一种API范式。