In 2007, Facebook open-sourced cross-language framework Thrift, which it had been using internally for the previous year. Thursday, following the addition of several features and a host of performance improvements, Thrift was re-open-sourced as FBThrift.
Facebook said in a post on its engineering blog that it addressed features that were lacking in its original release of Thrift, offering as examples:
- Internal service owners were being forced to continually reinvent features such as transport compression, authentication, and counters in order to track the health of their servers.
- The complexity of Thrift requests increased over time, going from straightforward requests to unique feature demands for specific services.
The social network also outlined the improvements that were made to what is now FBThrift:
Today we are releasing our evolved internal branch of Thrift (which we are calling FBThrift) on Github. The largest changes can be found in the new C++ code generator, available as the new target language, CPP2. The branch also includes all of the header transport and protocol changes for several languages, including C++, Python, and Java. For Java users, we expect similar changes to be reflected in Swift and Nifty.
Both the new Thrift C++ generated code and THeader format are being used by a number of Thrift services at Facebook. Service requests that go between data centers are dynamically compressed based on the size of the message, while in-rack requests skip compression (and thus avoid the CPU hit). A number of services that have moved to the new CPP2 generated code have seen up to a 50 percent decrease in latency, and/or large decreases in memory footprint.
Additionally, the new C++ async code is a dependency for newer HHVM releases.