论文标题

REST与GraphQl:一个受控的实验

REST vs GraphQL: A Controlled Experiment

论文作者

Brito, Gleison, Valente, Marco Tulio

论文摘要

GraphQl是一种用于实现基于服务的软件体系结构的新型查询语言。该语言正在增强动力,现在由Facebook和Github等主要软件公司使用。但是,我们仍然缺乏有关GraphQl取得的实际收益的经验证据,特别是在实施此语言所需的努力方面。因此,在本文中,我们描述了22名学生(10名本科生和12名毕业生)的对照实验,他们被要求实施8个查询,以使用GraphQL和REST进行访问Web服务。我们的结果表明,与休息相比,GraphQL需要更少的精力来实施远程服务查询(9 vs 6分钟,中位数时间)。当休息查询包含更复杂的端点(带有几个参数)时,这些收益会增加。有趣的是,即使在经验丰富的参与者中,GraphQL的表现都超过了(研究生的情况),而在具有以前的休息经验的参与者中,但没有以前的GraphQL经验。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源