GraphQL for building microservices
Puustinen, Ossi (2020)
Puustinen, Ossi
2020
Tietojenkäsittelyopin maisteriohjelma - Master's Programme in Computer Science
Informaatioteknologian ja viestinnän tiedekunta - Faculty of Information Technology and Communication Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2020-05-20
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202005065010
https://urn.fi/URN:NBN:fi:tuni-202005065010
Tiivistelmä
Most of the current day web applications follow a strict decoupling of the client and the backend. While REST has become the industry standard for writing APIs, it has its shortcomings - most notably data under- and over-fetching. GraphQL has been hyped as the successor of REST as the new standard for building Web based APIs. GraphQL offers clients a way to describe precisely the data and interactions they are interested in. Its big-name adopters include Shopify, Twitter, Atlassian and PayPal.
This thesis is a case study of a GraphQL microservice, which combines data from multiple different sources and offers it in a single cohesive data model. The objective of the study is to gather information on building GraphQL based microservices, best practices on resolving GraphQL queries and maintainability of a GraphQL server.
The results showed that GraphQL suited well for building microservices, but it is highly oriented towards serving client applications. There are some caveats on resolving hierarchical queries with GraphQL, which are well known and documented and can be avoided. GraphQL provides some benefits in the terms of project maintainability but might require more code to be written when compared to REST.
This thesis is a case study of a GraphQL microservice, which combines data from multiple different sources and offers it in a single cohesive data model. The objective of the study is to gather information on building GraphQL based microservices, best practices on resolving GraphQL queries and maintainability of a GraphQL server.
The results showed that GraphQL suited well for building microservices, but it is highly oriented towards serving client applications. There are some caveats on resolving hierarchical queries with GraphQL, which are well known and documented and can be avoided. GraphQL provides some benefits in the terms of project maintainability but might require more code to be written when compared to REST.