Skip to content
Eddie Elizondo edited this page Sep 18, 2017 · 10 revisions

Facebook Thrift Build Status

Thrift is a serialization and RPC framework for service communication. Thrift enables these features in all major languages, and there is strong support at Facebook for hack, c++, java, and python. Most services at Facebook are written using Thrift for RPC, and some storage systems use Thrift for serializing records on disk.

At a high level, Thrift is three major things:

A Code Generator

Thrift has a code generator to allow you to generate structures that can be serialized using Thrift, and client/server stubs for RPC, in different languages.

A Serialization Framework

Thrift has a set of protocols for serialization that you can use in different languages to serialize the generated structures created from the code generator.

An RPC Framework

Thrift has a framework to frame messages to send between clients and servers, and to call user defined callbacks when receiving messages in different languages.

There are several key goals for these components.

  • Ease of use
    Thrift takes care of the boilerplate of serialization and RPC, and enables you to focus on the schema of your structs and interface of your services.

  • Cross language support
    Thrift has strong support for C++, Python, Hack, and Java.

  • Performance
    Thrift structures and services are strongly typed to enable fast serialization and deserialization, and its RPC protocol and frameworks are designed with performance as a feature.

  • Backwards compatibility
    Thrift allows you to add and remove fields from structs in a manner that enables backwards compatibility.

Building

Dependencies

Please install the following dependencies before building Facebook Thrift:

System: Flex, Bison, Krb5, Zlib, PThreads. MacOSX: OpenSSLv1.0.2g

External: Double Conversion, GFlags, GLog, Mstch

Facebook: Folly, Wangle, Zstd

Build

git clone https://github.com/facebook/fbthrift cd build cmake .. # Add -DOPENSSL_ROOT_DIR for MacOSX. Usually in /usr/local/ssl make # or make install

This will create:

  • thrift1: The thrift compiler binary

Note: On MacOSX you need to specify -DOPENSSL_ROOT_DIR

Docs

Some docs on the new cpp2 server are at: https://github.com/facebook/fbthrift/blob/master/thrift/doc/Cpp2.md

C++ Static Reflection

Information regarding C++ Static Reflection support can be found under the static reflection library directory, in the corresponding README file.

Clone this wiki locally