Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How's the performance? As I recall, the way it does relationships is pretty sane as opposed to AR's defaults of N+1.


Performance is really good (not that we’re using it at scale - but apparently even there it shines).

They use a really clever technique for loading where not only do they. pull all the child data for multiple parent records as a single hit, they actually run a single query for multiple connected clients.

So if you have 10,000 connected clients subscribed to the same graphql queries, they build a temp table with 10k rows (one per client) and add all the environment variables. Then they execute the queries once to get all the data for everyone at once (joining to the temp table and also joining to all the tables for access rules you set up in Hasura). Then they split it up and send back the relevant chunks to each client. It’s much more performant than Postgres RSL because the rules can be executed in the joins in a way that works for every client at the same time.

Edit mobile typos


There are a lot of per-query optimizations that can be done, and I think I have read somewhere that Hasura does them very aggressively, ensuring performance even on complicated queries.

In any case, you won't have to worry about N+1 Query problems with Hasura.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: