StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Product

  • Stacks
  • Tools
  • Companies
  • Feed

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2025 StackShare. All rights reserved.

API StatusChangelog
  1. Stackups
  2. Stackups
  3. Apache Thrift vs GraphQL

Apache Thrift vs GraphQL

OverviewDecisionsComparisonAlternatives

Overview

Apache Thrift
Apache Thrift
Stacks179
Followers245
Votes0
GitHub Stars10.8K
Forks4.1K
GraphQL
GraphQL
Stacks34.4K
Followers28.1K
Votes309

Apache Thrift vs GraphQL: What are the differences?

Introduction

This article provides a comparison between Apache Thrift and GraphQL, highlighting their key differences.

  1. Declarative vs. Imperative: One of the fundamental differences between Thrift and GraphQL is their approach in defining APIs. Thrift follows an imperative approach where the API is defined using an IDL (Interface Definition Language) and strict contracts are enforced. On the other hand, GraphQL takes a declarative approach where the API is defined using a schema and clients can request the specific data they need.

  2. Type System: Thrift and GraphQL have different type systems. Thrift supports a fixed set of primitive types and allows the definition of complex data structures using structs and unions. GraphQL, on the other hand, has a flexible and extensible type system which allows defining custom scalar types, enums, interfaces, and unions.

  3. Transport Protocol: Thrift uses a binary protocol for data serialization and transportation, resulting in more efficient data transfer with smaller payload size. On the contrary, GraphQL uses HTTP as a transport protocol and the data is typically serialized and transmitted using JSON. This makes GraphQL more accessible and easier to integrate with existing web technologies.

  4. Data Fetching: In Thrift, the server-side defines the available data endpoints, and the client must adhere to those endpoints to fetch the data. In GraphQL, the client has the flexibility to specify the fields and nested data it needs, reducing the over-fetching or under-fetching issues commonly seen in traditional REST APIs.

  5. Efficiency: Thrift is known for its efficiency when it comes to serialization, deserialization, and network transfer, as it leverages a binary protocol. On the other hand, GraphQL introduces a higher level of abstraction, making it less efficient in terms of network transfer and serialization compared to Thrift.

  6. Ecosystem and Adoption: Apache Thrift has been around longer and has a larger ecosystem with support from various programming languages. Thrift is widely used and has been adopted by large companies for building scalable and high-performance APIs, often in distributed systems. GraphQL, although relatively newer, has gained significant popularity with its focus on front-end development and has an active community, making it a promising choice for modern web applications.

In summary, Thrift and GraphQL differ in their approach to API definition, type system, transport protocol, data fetching flexibility, efficiency, and ecosystem/adoption status.

Advice on Apache Thrift, GraphQL

Raj
Raj

Oct 10, 2020

Review

It purely depends on your app needs. Does it need to be scalable, do you have lots of features, OR it is a simple project with very simple needs - many of those parameters clarify which technologies will fit.

If you are looking for a quick solution, that reduces lot of development time, take a look at postgraphile (https://www.graphile.org/postgraphile/). You have to just define the schema and you get the entire graph-ql apis built for you and you can just focus on your frontend.

On frontend, React is good, but also need to remember that it is popular because it introduced one way data writes and in-built virtual dom + diffing to determine which dom to modify. Though personally I liked it, am recently more inclined to Svelte because its lightweightedness and absence of virtual dom and its simplicity compared to the huge ecosystem that React has surrounded itself with.

In all situations, frameworks keep changing over time. What is best today is not considered even good few years from now. What is important is to have the logic in a separate, clean manner void of too many framework related dependencies - that way you can switch one framework with another very easily.

3.75k views3.75k
Comments

Detailed Comparison

Apache Thrift
Apache Thrift
GraphQL
GraphQL

The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.

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.

-
Hierarchical;Product-centric;Client-specified queries;Backwards Compatible;Structured, Arbitrary Code;Application-Layer Protocol;Strongly-typed;Introspective
Statistics
GitHub Stars
10.8K
GitHub Stars
-
GitHub Forks
4.1K
GitHub Forks
-
Stacks
179
Stacks
34.4K
Followers
245
Followers
28.1K
Votes
0
Votes
309
Pros & Cons
No community feedback yet
Pros
  • 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
  • 12
    Get many resources in a single request
Cons
  • 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
    No built in security

What are some alternatives to Apache Thrift, GraphQL?

Prisma

Prisma

Prisma is an open-source database toolkit. It replaces traditional ORMs and makes database access easy with an auto-generated query builder for TypeScript & Node.js.

PostGraphile

PostGraphile

Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database

OData

OData

It is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. It helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc.

Oracle PL/SQL

Oracle PL/SQL

It is a powerful, yet straightforward database programming language. It is easy to both write and read, and comes packed with lots of out-of-the-box optimizations and security features.

SQL

SQL

SQL is designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).

MessagePack

MessagePack

It is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves.

Protobuf

Protobuf

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.

Avro

Avro

It is a row-oriented remote procedure call and data serialization framework developed within Apache's Hadoop project. It uses JSON for defining data types and protocols, and serializes data in a compact binary format.

JSON API

JSON API

It is most widely used data format for data interchange on the web. This data interchange can happen between two computers applications at different geographical locations or running within same hardware machine.

Serde

Serde

It is a framework for serializing and deserializing Rust data structures efficiently and generically. The ecosystem consists of data structures that know how to serialize and deserialize themselves along with data formats that know how to serialize and deserialize other things. It provides the layer by which these two groups interact with each other, allowing any supported data structure to be serialized and deserialized using any supported data format.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase