4 ms·
>One weakness I've observed is that since each attribute of an object can make its own DB query, you can have a situation where a single GraphQL query can creat
by Blackstone4 9y ago
>One weakness I've observed is that since each attribute of an object can make its own DB query, you can have a situation where a single GraphQL query can create dozens, or even hundreds, of individual DB queries, creating a performance issue with a naive implementation. This is mitigated with libraries that batch requests transparently, or with clever structuring of your schema that groups similar attributes into one query.
From my experience writing a GraphQL server, I completely agree. This could really impact performance.
I looked at multiple solutions including join-monster[0] and prisma [1] and settled on Prisma which I run on docker between my graphql server and my AWS RDS database. It translates queries into SQL for you :)
[0]https://github.com/stems/join-monster https://github.com/stems/join-monster
[1]https://github.com/graphcool/prisma https://github.com/graphcool/prisma
- headcanon 9y agoI wish I could use those, but the backend I'm working with is DynamoDB, with a relatively normalized data model. As in, we're using a non-relational database in a relational way, which means we're doing joins in javascript. GraphQL for us is a way to at least keep from doing that and abstract our client/server interactions so we can eventually transition to a more sane SQL environment.