Blazing Fast GraphQL Execution with Query Caching & Postgres Prepared Statements
The Hasura GraphQL Engine is designed for high performance and scalability. It can process a large number of queries (up to 1000 q/sec) with low latency, even in a small footprint of just 50MB RAM. Additionally, it supports massive concurrency, which is particularly useful for real-time applications. The performance metrics include high throughput and concurrency, as well as efficient handling of large queries and results. Hasura's GraphQL query processing architecture involves multiple stages, including parsing, validation, and planning. It compiles GraphQL to SQL using a compiler-based approach that allows for the formation of a single SQL query for any depth of GraphQL query. PostgreSQL prepared statements are leveraged to improve performance by skipping parsing in frequently repeated requests. This is particularly useful when dealing with authorization, as Hasura automates this process by providing developers with a fine-grained declarative auth DSL for every Postgres entity. JSON aggregations help in efficiently generating the SQL response into a neat JSON that the client can understand, reducing processing time and improving performance. Hasura's query caching eliminates parsing/validation for GraphQL queries, while prepared statements eliminate the same for PostgreSQL queries, resulting in high performance. Overall, Hasura's architecture ensures efficient handling of GraphQL queries and SQL execution plans, leading to improved performance and scalability.
Company
Hasura
Date published
Jan. 30, 2020
Author(s)
Praveen Durairaju
Word count
1416
Hacker News points
None found.
Language
English