Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
GraphQL vs. REST med relationsbaserade- och icke-relationsbaserade databaser: En komparativ studie av prestanda i webbtjänster.
University West, School of Business, Economics and IT.
2022 (Swedish)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [sv]

Med ökande användning av molntjänster och den snabba utvecklingen av mobila enheter ökar behovet av snabb och lättviktig datahämtning. Men för att kunna leverera en sömlös och effektiv upplevelse för användare och klienter krävs att kommunikationen mellan applikationer på internet också kan hålla en hög kvalité. En vanlig teknologi för kommunikation mellan webbtjänster är Representational State Transfer (REST)-arkitektur. REST medför begränsningar som kan minska möjligheten till att konstruera flexibla webbtjänster, vilket kan innebära en försämrad prestanda med längre responstider. Alternativa lösningar har börjat dyka upp däribland frågespråket GraphQL som utvecklats i syfte att tänja på de begränsningar som tidigare funnits och på så sätt uppnå en annan flexibilitet. För att bidra med ett resultat som var applicerbart i samband med olika typer av databaslösningar testades GraphQL och REST med både en relationsbaserad- och en icke-relationsbaserad databas.

I denna studie utfördes en jämförelse av prestanda vid olika typer av förfrågningar för att utvärdera om GraphQL kan bidra med flexibilitet och samtidigt bibehålla en likvärdig prestanda. Undersökningen gick ut på att mäta latens och datavolym vid mer eller mindre komplexa förfrågningar.

Resultaten av mätningarna visade att GraphQL presterar bättre än REST i avseende latens när fler än en slutpunkt används för REST. Vid enbart en slutpunkt är REST, vid användning av både SQL-databas och NoSQL-databas, snabbare än motparten GraphQL. I avseende datavolym presterar i samtliga fall REST bättre än GraphQL. Vid datahämtning från fyra slutpunkter i REST har GraphQL SQL en mindre datavolym än REST NoSQL, men REST SQL är fortfarande minst.

GraphQL med SQL-databas presterar i samtliga fall bättre än GraphQL med NoSQL-databas, i avseende både latens och datavolym.

I avseende latens presterar REST med NoSQL-databas bättre än REST med SQL-databas i tre fall av fyra. I avseendedatavolym presterar REST med SQL-databas bättre än REST med NoSQL-databas i samtliga fall, både i storlek på förfrågan och storlek på svar.

Abstract [en]

With increasing usage of cloud-based services and the rapid development of mobile devices the need for quick and lightweight data fetching rises. But to be able to deliver a seamless and effective experience for users and clients, it is necessary that the communication between applications on the internet can maintain a high quality. A common technology for communications between web services is Representational State Transfer (REST) architecture. REST entails restrictions that can reduce the ability to design flexible web services, which can mean a degraded performance with longer response times. Alternative solutions have begun to emerge, including the query language GraphQL, which has been developed with the aim of stretching the limitations that previously existed and thus achieving a different flexibility. To contribute with aresult that was applicable with different types of database solutions, GraphQL and REST were tested with both a relational- and a non-relational database.

In this study, a comparison of performance with different types of queries was performed to evaluate whether GraphQL can contribute with flexibility while maintaining an equivalent performance. The study was based on measuring latency and data volume for a more or less complex set of requests.

The results showed that GraphQL performs better than REST in terms of latency when more than one endpoint is used for REST. At only one endpoint, REST, when using both a SQL- and a NoSQL database, is faster than its GraphQL counterpart. In terms of data volume, REST performs better than GraphQL in all cases. When requesting data from four endpoints in REST, GraphQL has a smaller data volume than REST NoSQL, but REST SQL is still the smallest. 

GraphQL with SQL a database performs better than GraphQL with NoSQL database, in terms of both latency and data volume, in all cases. In terms of latency, REST with NoSQL database performs better than REST with a SQL database in three cases out of four. In terms of data volume, REST with a SQL database performs better than REST with a NoSQL database in all cases both in size of request and size of response. 

Place, publisher, year, edition, pages
2022. , p. 34
Keywords [en]
GraphQL, REST, SQL, NoSQL, latency, data volume, data fetching, API, web services.
Keywords [sv]
GraphQL, REST, SQL, NoSQL, latens, datavolym, datahämtning, API, webbtjänster
National Category
Information Systems, Social aspects
Identifiers
URN: urn:nbn:se:hv:diva-18533Local ID: EXI500OAI: oai:DiVA.org:hv-18533DiVA, id: diva2:1671631
Subject / course
Informatics
Educational program
Systemutveckling - IT och samhälle
Supervisors
Examiners
Available from: 2022-06-21 Created: 2022-06-17 Last updated: 2022-06-21Bibliographically approved

Open Access in DiVA

No full text in DiVA

By organisation
School of Business, Economics and IT
Information Systems, Social aspects

Search outside of DiVA

GoogleGoogle Scholar

urn-nbn

Altmetric score

urn-nbn
Total: 486 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf