REST与GraphQL的对照实验
REST vs GraphQL: A Controlled Experiment
摘要:
GraphQL是一种用于实现基于服务的软件架构的新型查询语言。该语言正在获得发展势头,现在被Facebook和GitHub等主要软件公司使用。然而,我们仍然缺乏经验证据来证明GraphQL所取得的真正收益,特别是在这种语言中实现查询所需的工作量方面。因此,在本文中,我们描述了一个对照实验与22名学生(10名本科生和12名研究生),谁被要求实现八个查询访问Web服务,使用GraphQL和REST。我们的研究结果表明,与REST相比,GraphQL实现远程服务查询所需的工作量更少(9 vs 6分钟,中位数时间)。当REST查询包括更复杂的端点时,这些收益会增加,并带有多个参数。有趣的是,GraphQL甚至在更有经验的参与者(如研究生)和以前有REST经验但没有GraphQL经验的参与者中也优于REST。
英文摘要:
GraphQL is a novel query language for implementing service-based software architectures. The language is gaining momentum and it is now used by major software companies, such as Facebook and GitHub. However, we still lack empirical evidence on the real gains achieved by GraphQL, particularly in terms of the effort required to implement queries in this language. Therefore, in this paper we describe a controlled experiment with 22 students (10 undergraduate and 12 graduate), who were asked to implement eight queries for accessing a web service, using GraphQL and REST. Our results show that GraphQL requires less effort to implement remote service queries when compared to REST (9 vs 6 minutes, median times). These gains increase when REST queries include more complex endpoints, with several parameters. Interestingly, GraphQL outperforms REST even among more experienced participants (as is the case of graduate students) and among participants with previous experience in REST, but no previous experience in GraphQL.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。