4 ms·
Sorry for my ignorance about the project, GraphQL looks awesome in terms of flexibility while developing and saving network traffic, but I have a question relat
by tuyguntn 11y ago
Sorry for my ignorance about the project, GraphQL looks awesome in terms of flexibility while developing and saving network traffic, but I have a question related to how API backend will work with GraphQL.
If storage was some kind of NoSQL and stores everything as one huge JSON, then we can filter out data while retrieving, but what would happen if data storage is RDBMS?
Are we going to do multiple joins to retrieve data?
seems GraphQL work really well with graph databases, but if you have 2-3nesting in GraphQL query, then you need to do multiple big joins on the server side
- tbrock 11y agoFacebook made it, so even though they are using an RDBMS they aren't doing any joins. They use MySQL just as you would a nosql datastore in that to "join" data they are doing multiple queries and stitching the results together manually.
- lojack 11y agoYes, you could end up with multiple big joins. The advantage is that you're at least only doing a single query for those joins. What would be worse is performing joins on the client and doing three separate queries to get the data you need. Also, keep in mind that this is a query language and not an API spec. If you want to allow clients to perform massive joins then GraphQL will facilitate that, but that's your decision to make. Ultimately you still need to decide what clients can and can not query.