GraphQL vs Node.js: What are the differences?
GraphQL can be classified as a tool in the "Query Languages" category, while Node.js is grouped under "Frameworks (Full Stack)".
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.
What is GraphQL?
What is Node.js?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
Sign up to add, upvote and see more consMake informed product decisions
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
When I joined NYT there was already broad dissatisfaction with the LAMP (Linux Apache HTTP Server MySQL PHP) Stack and the front end framework, in particular. So, I wasn't passing judgment on it. I mean, LAMP's fine, you can do good work in LAMP. It's a little dated at this point, but it's not ... I didn't want to rip it out for its own sake, but everyone else was like, "We don't like this, it's really inflexible." And I remember from being outside the company when that was called MIT FIVE when it had launched. And been observing it from the outside, and I was like, you guys took so long to do that and you did it so carefully, and yet you're not happy with your decisions. Why is that? That was more the impetus. If we're going to do this again, how are we going to do it in a way that we're gonna get a better result?
So we're moving quickly away from LAMP, I would say. So, right now, the new front end is React based and using Apollo. And we've been in a long, protracted, gradual rollout of the core experiences.
React is now talking to GraphQL as a primary API. There's a Node.js back end, to the front end, which is mainly for server-side rendering, as well.
Behind there, the main repository for the GraphQL server is a big table repository, that we call Bodega because it's a convenience store. And that reads off of a Kafka pipeline.
I just finished the very first version of my new hobby project: #MovieGeeks. It is a minimalist online movie catalog for you to save the movies you want to see and for rating the movies you already saw. This is just the beginning as I am planning to add more features on the lines of sharing and discovery
For the #BackEnd I decided to use Node.js , GraphQL and MongoDB:
Node.js has a huge community so it will always be a safe choice in terms of libraries and finding solutions to problems you may have
GraphQL because I needed to improve my skills with it and because I was never comfortable with the usual REST approach. I believe GraphQL is a better option as it feels more natural to write apis, it improves the development velocity, by definition it fixes the over-fetching and under-fetching problem that is so common on REST apis, and on top of that, the community is getting bigger and bigger.
MongoDB was my choice for the database as I already have a lot of experience working on it and because, despite of some bad reputation it has acquired in the last months, I still believe it is a powerful database for at least a very long list of use cases such as the one I needed for my website
I just finished a web app meant for a business that offers training programs for certain professional courses. I chose this stack to test out my skills in graphql and react. I used Node.js , GraphQL , MySQL for the #Backend utilizing Prisma as a database interface for MySQL to provide CRUD APIs and graphql-yoga as a server. For the #frontend I chose React, styled-components for styling, Next.js for routing and SSR and Apollo for data management. I really liked the outcome and I will definitely use this stack in future projects.
We are always building new features and replacing old code at StackShare. Lately we have been building out new features for the frontend, and removing a lot of old jQuery code (sorry jQuery but it's time to go).
As we've moved towards the above tech, its really made smashing out new features and updating legacy code super fast, and really fun!
Have been working on a side project that focuses on sharing economy, allowing users to pickup and deliver groceries for others. Have already started working on the frontend for the web dashboard using React and plan to use React Native for the mobile app. But am in a dilemma, whether to build the backend myself for the MVP or use firebase for the backend. I need advise, has anyone use Firebase for such project and what are the pros and cons, what issues will i faced.
Note: My proposed stack for the backend is a Prisma database, GraphQL , Apollo and ExpressJS
Thanks in advance to everyone.
The power of SSR React and then hydrating it client-side to add interactivity and App-like feel is what makes Gatsby powerful.
It comes with a ton of plugins, that are mind-boggling: Image Processing, GraphQL, Node.js, and so much more. This is thanks to a great ecosystem, a great user-base and the revolutionary Community work, which led to the Gatsby repo to be one of the most committed to, out there.
Mixmax was originally built using Meteor as a single monolithic app. As more users began to onboard, we started noticing scaling issues, and so we broke out our first microservice: our Compose service, for writing emails and Sequences, was born as a Node.js service. Soon after that, we broke out all recipient searching and storage functionality to another Node.js microservice, our Contacts service. This practice of breaking out microservices in order to help our system more appropriately scale, by being more explicit about each microservice’s responsibilities, continued as we broke out numerous more microservices.
As Mixmax began to scale super quickly, with more and more customers joining the platform, we started to see that the Meteor app was still having a lot of trouble scaling due to how it tried to provide its reactivity layer. To be honest, this led to a brutal summer of playing Galaxy container whack-a-mole as containers would saturate their CPU and become unresponsive. I’ll never forget hacking away at building a new microservice to relieve the load on the system so that we’d stop getting paged every 30-40 minutes. Luckily, we’ve never had to do that again! After stabilizing the system, we had to build out two more microservices to provide the necessary reactivity and authentication layers as we rebuilt our Meteor app from the ground up in Node.js. This also had the added benefit of being able to deploy the entire application in the same AWS VPCs. Thankfully, AWS had also released their ALB product so that we didn’t have to build and maintain our own websocket layer in Amazon EC2. All of our microservices, except for one special Go one, are now in Node with an nginx frontend on each instance, all behind AWS Elastic Load Balancing (ELB) or ALBs running in AWS Elastic Beanstalk.
In my last side project, I built a web posting application that has similar features as Facebook and hosted on Heroku. The user can register an account, create posts, upload images and share with others. I took an advantage of graphql-subscriptions to handle realtime notifications in the comments section. Currently, I'm at the last stage of styling and building layouts.
For the #Backend I used graphql-yoga, Prisma, GraphQL with PostgreSQL database. For the #FrontEnd: React, styled-components with Apollo. The app is hosted on Heroku.
We are in the process of building a modern content platform to deliver our content through various channels. We decided to go with Microservices architecture as we wanted scale. Microservice architecture style is an approach to developing an application as a suite of small independently deployable services built around specific business capabilities. You can gain modularity, extensive parallelism and cost-effective scaling by deploying services across many distributed servers. Microservices modularity facilitates independent updates/deployments, and helps to avoid single point of failure, which can help prevent large-scale outages. We also decided to use Event Driven Architecture pattern which is a popular distributed asynchronous architecture pattern used to produce highly scalable applications. The event-driven architecture is made up of highly decoupled, single-purpose event processing components that asynchronously receive and process events.
To build our #Backend capabilities we decided to use the following: 1. #Microservices - Java with Spring Boot , Node.js with ExpressJS and Python with Flask 2. #Eventsourcingframework - Amazon Kinesis , Amazon Kinesis Firehose , Amazon SNS , Amazon SQS, AWS Lambda 3. #Data - Amazon RDS , Amazon DynamoDB , Amazon S3 , MongoDB Atlas
To build #Webapps we decided to use Angular 2 with RxJS
#Devops - GitHub , Travis CI , Terraform , Docker , Serverless
We recently implemented GraphQL because we needed to build dynamic reports based on the user preference and configuration, this was extremely complicated with our actual RESTful API, the code started to get harder to maintain but switching to GraphQL helped us to to build beautiful reports for our clients that truly help them make data-driven decisions.
Our goal is to implemented GraphQL in the whole platform eventually, we are using Graphene , a python library for Django .
At IT Minds we create customized internal or #B2B web and mobile apps. I have a go to stack that I pitch to our customers consisting of 3 core areas. 1) A data core #backend . 2) A micro #serverless #backend. 3) A user client #frontend.
For the Data Core I create a backend using TypeScript Node.js and with TypeORM connecting to a PostgreSQL Exposing an action based api with Apollo GraphQL
For the micro serverless backend, which purpose is verification for authentication, autorization, logins and the likes. It is created with Next.js api pages. Using MongoDB to store essential information, caching etc.
Finally the frontend is built with React using Next.js , TypeScript and @Apollo. We create the frontend as a PWA and have a AMP landing page by default.
I've been using Django for quite a long time and in my opinion I would never switch from it. My company is currently using Django with REST framework and a part in GraphQL using Graphene. On the frontend we use Next.js and so far everything has been running quite good. I've found limitations but manage to solve it.
As someone mentioned before, if you are comfortable with Django, don't switch. There's no need since with django you can basically achieve anything. Of course this will depend on the project you want to build, but the scalability and flexibility django can offer it's just out of this world. (Don't want to sound like a fan boy haha but it really is).
I want to create a video sharing service like Youtube, which users can use to upload and watch videos. I prefer to use Vue.js for front-end. What do you suggest for the back-end? Node.js or Laravel ( PHP ) I need a good performance with high speed, and the most important thing is the ability to handle user's requests if the site's traffic increases. I want to create an algorithm that users who watch others videos earn points (randomly but in clear context) If you have anything else to improve, please let me know. For eg: If you prefer React to Vue.js. Thanks in advance
Since you said that your middleware will be accessing DB and expose API, you can go with Node.js. It will make your development fast and easy. Suppose in future you will add some business logic you can choose Java with Spring Boot or Python with Flask / Django. NOTE: Language or framework doesn't matter. Choose based on your programming knowledge.
I have benchmarked Node.js and other popular frameworks using a real life application example. You can find the results here: https://email@example.com/web-rest-api-benchmark-on-a-real-life-application-ebb743a5d7a3
We decided to move the provisioning process to an API-driven process, and had to decide among a few implementation languages:
- Go, the server-side language from Google
We built prototypes in both languages, and decided on NodeJS:
- NodeJS is asynchronous-by-default, which suited the problem domain. Provisioning is more like “start the job, let me know when you’re done” than a traditional C-style program that’s CPU-bound and needs low-level efficiency.
- NodeJS acts as an HTTP-based service, so exposing the API was trivial
Getting into the headspace and internalizing the assumptions of a tool helps pick the right one. NodeJS assumes services will be non-blocking/event-driven and HTTP-accessible, which snapped into our scenario perfectly. The new NodeJS architecture resulted in a staggering 95% reduction in processing time: requests went from 7.5 seconds to under a second.
The server side of Trello is built in Node.js. We knew we wanted instant propagation of updates, which meant that we needed to be able to hold a lot of open connections, so an event-driven, non-blocking server seemed like a good choice. Node also turned out to be an amazing prototyping tool for a single-page app. The prototype version of the Trello server was really just a library of functions that operated on arrays of Models in the memory of a single Node.js process, and the client simply invoked those functions through a very thin wrapper over a WebSocket. This was a very fast way for us to get started trying things out with Trello and making sure that the design was headed in the right direction. We used the prototype version to manage the development of Trello and other internal projects at Fog Creek.
All backend code is done in node.js
We have a SOA for our systems. It isn't quite Microservices jsut yet, but it does provide domain encapsulation for our systems allowing the leaderboards to fail without affecting the login or education content.
We've written a few internal modules including a very simple api framework.
I don't know how well this will scale if/when I have hundreds of people connected simultaneously, but I suspect that when that time comes, it may be just a matter of increasing the hardware.
Used node.js server as backend. Interacts with MongoDB using MongoSkin package which is a wrapper for the MongoDB node.js driver. It uses express for routing and cors package for enabling cors and eyes package for enhancing readability of logs. Also I use nodemon which takes away the effort to restart the server after making changes.
GraphQL will be used as the public API for the data persistence layer. It communicates nicely with all other languages and can provide API responses in the format specified in the request.
Applied GraphQL in a side-project I'm currently working on. Using the Apollo GraphQL implementation for both server-side and React client.
From Magento 2.3 GraphQL is provider by a core implementation, this is used to implement PWA frontend.