Architecture of a high performance GraphQL to SQL engine
The Hasura platform's data microservice provides a HTTP API to query Postgres using GraphQL or JSON in a permission safe way. It is designed for high performance with fast response times, large throughput, and low CPU and memory usage. A GraphQL query goes through stages of session resolution, query parsing, validation, execution, and response generation. The architecture aims to minimize HTTP stack overhead, enable efficient query translation from GraphQL to SQL, generate efficient Postgres compiled SQL queries, and efficiently send back results. Optimizations include batching queries, using joins for data collection, optimizing response generation by pushing transformations into Postgres, and utilizing prepared statements. These enhancements result in significant performance benefits compared to other architectures.
Company
Hasura
Date published
April 19, 2018
Author(s)
Sandip
Word count
1449
Language
English
Hacker News points
None found.