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

Hey Yury, Cool stuff!

How do you folks solve the large amount of joins that are the result of graph queries? Any worst-case-optimal multi-way-join secret sauce :D?

Also, with DBs like Datomic competing in the same area, do you have an immutability/versioning story?



Thanks! The secret sauce is to pack nested shape queries into array_agg-ed SQL subquery. So we never select unnecessarily wide rows.


Sounds like this is not dissimilar from the GraphQL-to-SQL compiler in Hasura, which also brings out surprising performance for wildly nested frontend queries.


Yeah, indeed, Hasura uses json_agg, which is similar but returns you a JSON string.

We use array_agg, so we often avoid data serialization altogether. Our binary protocol just lets the data messages pass through with the original binary encoding. And because we fully control the schema, we can make all sorts of interesting optimizations, like implementing high-perf data codecs on the client side to unpack data fast.


Yeah, that‘s an appealing idea, if there never even has to be any json.

Hasura has the frontend safe API and strong authz going for it. Is that something you might also do, or are you focused on serving the backend? End-user row and column level authz gives me a lot of peace of mind when writing bigger queries.




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

Search: