In 2015, Facebook introduced GraphQL, a front-end query framework designed to shield users from the intricacies of the various backends one would find in modern data stacks. As with ORMs before then, most backend code ended up being databases, adding layers of abstraction that ended up being inefficient and required immense investments to scale out for performance.
Additionally, most app developers are not very familiar with SQL and go to great lengths to avoid learning it. This has created several problems like n+1 queries, inefficient queries, minimal use of database features, etc. While Postgres is growing in popularity with this audience the large majority of advanced features like JSON support, Recursive CTE’s, Window functions are never used. Often developers are unfamiliar with even simple features like the various types of JOINS and choose inefficient solutions like multiple queries instead.
GraphJin, an open-source project, was developed to solve this disconnect by putting all the power in the hands of the UI/UX developer and freeing up the backend developer to focus on the truly hard problems and optimize the queries to take full advantage of the advanced features of Postgres.
GraphJin is a compiler written in Go that can convert the GraphQL describing the data needed into a single efficient SQL query optimized for Postgres or MySQL. It discovers the schema and relationship graph of the database to help it build efficient queries and provide the frontend developer an auto-complete enabled GraphQL query builder to quickly fetch the data needed.
https://github.com/dosco/graphjin
Speaker: Vikram Rangnekar – 42papers.com