← Lessons

quiz vs the machine

Gold1340

Networking

The Thrift Overview

A pluggable RPC framework with swappable protocols and transports.

4 min read · core · beat Gold to climb

Another RPC Framework

Apache Thrift is an RPC framework, originally from Facebook, that like gRPC generates code from an interface definition. Its distinguishing trait is how modular it is.

The Layered Design

Thrift separates concerns into swappable layers.

  • An interface definition describes services and data types.
  • A protocol layer decides the wire encoding, such as a compact binary form or a text form.
  • A transport layer decides how bytes move, such as a socket or a buffer.
  • A server type decides the concurrency model.

Why The Layers Matter

Because protocol and transport are independent, you can mix and match them.

  • Pick a compact binary protocol for speed.
  • Pick a framed transport when a server needs message boundaries.
  • Swap layers without changing the service definition.

This flexibility was a strength when text and binary needs varied widely across languages. The trade off is more choices to get right, and the ecosystem is smaller than that of gRPC today. Thrift remains common in older large scale systems.

Key idea

Thrift is a modular RPC framework whose independent protocol and transport layers can be mixed to suit a system, giving flexibility at the cost of more configuration choices than gRPC.

Check yourself

Answer to earn rating on the learn ladder.

1. What is Thrift best known for compared with other frameworks?

2. What does the protocol layer in Thrift decide?