Upload
yanns
View
1.725
Download
0
Embed Size (px)
Citation preview
Optimising response times with GraphQLan experiment with MongoDB and ElasticSearch
(These slides were adapted to be suitable offline)
Not obvious• Client has to send more info
• query contains list of fields
• -> biggest requests payloads
• Server has more work to do
• query validation
• customise response
query($offset: Int!, $limit: Int!) { products(offset: $offset, limit: $limit) { results { id version } }}
In GraphiQL
GaphQL query
In Mongo
db .getCollection('products') .find({})
db .getCollection('products') .find({}, {_id: 1, version: 1})
• Optimising database queries have an important impact on performances
• GraphQL allows to optimise from client to data storage
• Tested use-case intentionally picked to be favorable to GraphQL (test assumption)
• Test yourself for your use-case
• Should not choose GraphQL primary for performances but for features