This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Optimising response times with GraphQLan experiment with MongoDB and ElasticSearch
(These slides were adapted to be suitable offline)
Intuitions: GraphQL faster
• less requests
• smaller responses
Reality Eats Intuitions
for Breakfast
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
Do not guess it,
test it
–A client
“I want the id and the versions of all products”
30000 50000 100000
MongoDB ES
Perf of REST endpoints
query($offset: Int!, $limit: Int!) { products(offset: $offset, limit: $limit) { results { id version } }}