Hacker News new | ask | show | jobs
by fictionfuture 2280 days ago
Does GraphQL really make sense with MongoDB?

I love MongoDB but GraphQL is being used in many cases where it adds zero value, only another layer of complexity and abstraction.

6 comments

Side note, why do you love MongoDB? I've never had a situation where I believed it would fit my current problem better, so I really don't know why people use it.
I think productivity is much higher at least with NodeJS, but for large projects I would do in Postgre/MySQL.
But what can you do with MongoDB that you can't do with Postgres? (Not sure about MySQL)

Last I read, JSONB performance is actually better in Postgres anyway, and you also get the ability to expand into relational data if you want to.

Hi, thank you for your response! I am not closed to MongoDB of course. This is just the beginning. I will integrate PostgreSQL and Dgraph for sure. I am more interested if you ever worked with Terminal languages/CLI/generators and what is your experience.
I feel like it’s the new cool fad that everyone is trying to retrofit into their api for 0 benefits.
Having more implementations of GraphQL APIs for various backends is tremendously useful for data integration using schema stitching / federation / remote schemas. And even without that it provides a uniform way to address many types of data stores.

Also the term 'retrofit' is a bit odd for an API, as there is no canonical backend, so there are only retrofits in that sense.

It's not odd at all. If you have existing datastore(s) and APIs, and you try to add GraphQL on top of it. You're trying to retrofit it.

> add (a component or accessory) to something that did not have it when manufactured.

GraphQL doesn't magically just tie into a datastore and allow you to query it.

In most cases, adding GraphQL just add's another layer of complexity and doesn't solve any existing problem for people.

I'm not saying GraphQL is bad. It's just massively miss/over used now.

It makes sense if you plan on doing schema stitching and the like. You can combine multiple graphql schemas into a single big schema reasonably easily, and it might make sense doing so if you have multiple datastore-type backends and you just want your internal code to talk to a single endpoint.
And stucco( core ) is compatible with any kind of database