Need advice about which tool to choose?Ask the StackShare community!
GraphQL vs Node.js: What are the differences?
Developers describe GraphQL as "A data query language and runtime". GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012. On the other hand, Node.js is detailed as "A platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications". Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
GraphQL can be classified as a tool in the "Query Languages" category, while Node.js is grouped under "Frameworks (Full Stack)".
"Schemas defined by the requests made by the user", "Will replace RESTful interfaces" and "The future of API's" are the key factors why developers consider GraphQL; whereas "Npm", "Javascript" and "Great libraries" are the primary reasons why Node.js is favored.
GraphQL and Node.js are both open source tools. Node.js with 35.5K GitHub stars and 7.78K forks on GitHub appears to be more popular than GraphQL with 11.7K GitHub stars and 753 GitHub forks.
Uber Technologies, Netflix, and Medium are some of the popular companies that use Node.js, whereas GraphQL is used by Facebook, Instagram, and Twitter. Node.js has a broader approval, being mentioned in 4104 company stacks & 4039 developers stacks; compared to GraphQL, which is listed in 561 company stacks and 750 developer stacks.
We actually initially wrote a lot of networking code in Kotlin but the complexities involved prompted us to try and compile NodeJS for Android and port over all the networking logic to Node and communicate with node over the Java Native Interface.
This turned out to be a great decision considering our battery usage fell by 40% and rate of development increased by a factor of 2.
As a small team, we wanted to pick the framework which allowed us to move quickly. There's no option better than Rails. Not having to solve the fundamentals means we can more quickly build our feature set. No other framework can beat ActiveRecord in terms of integration & ease-of use. To top it all of, there's a lot of attention paid to security in the framework, making almost everything safe-by-default.
Hey guys,
My backend set up is Prisma / GraphQL-Yoga at the moment, and I love it. It's so intuitive to learn and is really neat on the frontend too, however, there were a few gotchas when I was learning! Especially around understanding how it all pieces together (the stack). There isn't a great deal of information out there on exactly how to put into production my set up, which is a backend set up on a Digital Ocean droplet with Prisma/GraphQL Yoga in a Docker Container using Next & Apollo Client on the frontend somewhere else. It's such a niche subject, so I bet only a few hundred people have got a website with this stack in production. Anyway, I wrote a blog post to help those who might need help understanding it. Here it is, hope it helps!
Pros of GraphQL
- Schemas defined by the requests made by the user69
- Will replace RESTful interfaces61
- The future of API's57
- The future of databases47
- Self-documenting11
- Get many resources in a single request10
- Ask for what you need, get exactly that5
- Query Language4
- Evolve your API without versions3
- Type system3
- GraphiQL2
- Ease of client creation2
- Fetch different resources in one request2
- Good for apps that query at build time. (SSR/Gatsby)1
- Backed by Facebook1
- Easy to learn1
- "Open" document1
- Better versioning1
- Standard1
- 1. Describe your data1
- Easy setup1
- Fast prototyping1
Pros of Node.js
- Npm1.4K
- Javascript1.3K
- Great libraries1.1K
- High-performance1K
- Open source789
- Great for apis476
- Asynchronous467
- Great community414
- Great for realtime apps385
- Great for command line utilities290
- Node Modules77
- Websockets75
- Uber Simple65
- Great modularity53
- Allows us to reuse code in the frontend53
- Easy to start38
- Great for Data Streaming33
- Realtime29
- Awesome25
- Non blocking IO23
- Can be used as a proxy16
- High performance, open source, scalable15
- Non-blocking and modular14
- Easy and Fun13
- Same lang as AngularJS12
- Easy and powerful11
- Future of BackEnd10
- Fast9
- Cross platform8
- Scalability8
- Simple6
- Fullstack6
- Mean Stack6
- Easy concurrency5
- Great for webapps5
- Easy to use and fast and goes well with JSONdb's4
- Friendly4
- React4
- Fast, simple code and async4
- Typescript4
- Isomorphic coolness3
- Its amazingly fast and scalable3
- Control everything3
- Great speed3
- Fast development3
- Scalable3
- One language, end-to-end2
- Scales, fast, simple, great community, npm, express2
- TypeScript Support2
- Easy to learn2
- Easy to use2
- Less boilerplate code2
- Not Python2
- It's fast2
- Blazing fast2
- Performant and fast prototyping2
- Sooper easy for the Backend connectivity2
- Great community2
- Lovely1
- Event Driven0
- Javascript20
Sign up to add or upvote prosMake informed product decisions
Cons of GraphQL
- More code to type.3
- Hard to migrate from GraphQL to another technology2
- Works just like any other API at runtime1
- Takes longer to build compared to schemaless.1
Cons of Node.js
- Bound to a single CPU46
- New framework every day37
- Lots of terrible examples on the internet33
- Asynchronous programming is the worst28
- Callback22
- Javascript16
- Dependency based on GitHub11
- Dependency hell10
- Low computational power10
- Can block whole server easily7
- Callback functions may not fire on expected sequence6
- Very very Slow6
- Unneeded over complication3
- Breaking updates3
- Unstable3
- No standard approach1