Skip to content
uencoder

Thrift Protocol

The Thrift protocol is Apache Thrift's RPC wire format, supporting multiple encodings (Binary/Compact/JSON) and transports such as TBufferedTransport/TSocket.

Purpose

It provides compact, efficient binary message encoding and a transport abstraction for cross-language Thrift RPC.

Mechanism

TBinaryProtocol writes type tags + field IDs + values as strict binary; TCompactProtocol compresses with varint + zigzag; TJSONProtocol encodes as JSON. The transport layer wraps socket/buffer/http.

Use cases

  • Facebook internal RPC
  • Cross-language service communication
  • Hadoop inter-service communication

Related tools

References