Need advice about which tool to choose?Ask the StackShare community!

GraphQL

32.3K
26.2K
+ 1
310
gRPC

2.1K
1.3K
+ 1
64
Add tool

GraphQL vs gRPC: What are the differences?

GraphQL: 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; gRPC: A high performance, open-source universal RPC framework. gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking...

GraphQL can be classified as a tool in the "Query Languages" category, while gRPC is grouped under "Remote Procedure Call (RPC)".

Some of the features offered by GraphQL are:

  • Hierarchical
  • Product-centric
  • Client-specified queries

On the other hand, gRPC provides the following key features:

  • Simple service definition
  • Works across languages and platforms
  • Start quickly and scale

GraphQL and gRPC are both open source tools. It seems that gRPC with 22K GitHub stars and 5.12K forks on GitHub has more adoption than GraphQL with 11.7K GitHub stars and 753 GitHub forks.

According to the StackShare community, GraphQL has a broader approval, being mentioned in 561 company stacks & 750 developers stacks; compared to gRPC, which is listed in 53 company stacks and 48 developer stacks.

Decisions about GraphQL and gRPC
Prateek Mittal
Fullstack Engineer| Ruby | React JS | gRPC at Ex Bookmyshow | Furlenco | Shopmatic · | 8 upvotes · 33.7K views

gRPC with Protobuf has clear winning and pros and the most importantly easy and fun to write and scale

  1. HTTP/2 vs. HTTP 1.1
  2. Messages vs. Resources and Verbs
  3. The gRPC Gateway. Server 2 Server (S2S) calls in mind- gRPC is way to go. Browser support is not as mature. gRPC is mainly used primarily for internal services that are not exposed directly to the world. Exposing that big workflow for your order, warehouse, async jobs management as API service and RPC call scripted using gRPC is way to go
  4. Streaming vs. Request-Response. Try built-in health check streaming service and understand the use case. Ever wanted S2S streaming w/o browser involved, this is the solution.
  5. Bored of too much REST ?? ;)
See more
Mickael Alliel
DevOps Engineer at Rookout · | 6 upvotes · 20.6K views

At the start of Rookout, we used to have a giant Python monolith and it started being hard to maintain - we realized that using Kubernetes, it would be easy enough to have multiple micro-services each responsible for their own tasks.

After almost a year of micro-services, we are slowly slimming it down to a Golang backend with a NodeJS GraphQL facade for easier frontend development.

NodeJS has the most popular and better options for GraphQL, and it is for a reason.

Between having protobuf schemas between our services, a GraphQL schema to manage our queries, and a very durable backend in Golang, we are able to do anything we want and handle large scale very easily.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of GraphQL
Pros of gRPC
  • 75
    Schemas defined by the requests made by the user
  • 63
    Will replace RESTful interfaces
  • 62
    The future of API's
  • 49
    The future of databases
  • 13
    Self-documenting
  • 12
    Get many resources in a single request
  • 6
    Query Language
  • 6
    Ask for what you need, get exactly that
  • 3
    Fetch different resources in one request
  • 3
    Type system
  • 3
    Evolve your API without versions
  • 2
    Ease of client creation
  • 2
    GraphiQL
  • 2
    Easy setup
  • 1
    "Open" document
  • 1
    Fast prototyping
  • 1
    Supports subscription
  • 1
    Standard
  • 1
    Good for apps that query at build time. (SSR/Gatsby)
  • 1
    1. Describe your data
  • 1
    Better versioning
  • 1
    Backed by Facebook
  • 1
    Easy to learn
  • 25
    Higth performance
  • 15
    The future of API
  • 13
    Easy setup
  • 5
    Contract-based
  • 4
    Polyglot
  • 2
    Garbage

Sign up to add or upvote prosMake informed product decisions

Cons of GraphQL
Cons of gRPC
  • 4
    Hard to migrate from GraphQL to another technology
  • 4
    More code to type.
  • 2
    Takes longer to build compared to schemaless.
  • 1
    No support for caching
  • 1
    All the pros sound like NFT pitches
  • 1
    No support for streaming
  • 1
    Works just like any other API at runtime
  • 1
    N+1 fetch problem
  • 1
    No built in security
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    - No public GitHub repository available -

    What is GraphQL?

    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.

    What is gRPC?

    gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking...

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use GraphQL?
    What companies use gRPC?
    See which teams inside your own company are using GraphQL or gRPC.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with GraphQL?
    What tools integrate with gRPC?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    GitHubDockerReact+17
    38
    35390
    GitHubPythonNode.js+47
    54
    71936
    What are some alternatives to GraphQL and gRPC?
    Falcor
    Falcor lets you represent all your remote data sources as a single domain model via a virtual JSON graph. You code the same way no matter where the data is, whether in memory on the client or over the network on the server.
    React
    Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
    graphql.js
    Lightest GraphQL client with intelligent features. You can download graphql.js directly, or you can use Bower or NPM.
    MongoDB
    MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
    REST
    An architectural style for developing web services. A distributed system framework that uses Web protocols and technologies.
    See all alternatives