Thrift Protocol (Facebook)

Thrift Protocol (Facebook) - Thrift Scalable Cross-Language...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Thrift: Scalable Cross-Language Services Implementation Mark Slee, Aditya Agarwal and Marc Kwiatkowski Facebook, 156 University Ave, Palo Alto, CA { mcslee,aditya,marc } @facebook.com Abstract Thrift is a software library and set of code-generation tools devel- oped at Facebook to expedite development and implementation of efficient and scalable backend services. Its primary goal is to en- able efficient and reliable communication across programming lan- guages by abstracting the portions of each language that tend to require the most customization into a common library that is imple- mented in each language. Specifically, Thrift allows developers to define datatypes and service interfaces in a single language-neutral file and generate all the necessary code to build RPC clients and servers. This paper details the motivations and design choices we made in Thrift, as well as some of the more interesting implementation details. It is not intended to be taken as research, but rather it is an exposition on what we did and why. 1. Introduction As Facebook’s traffic and network structure have scaled, the re- source demands of many operations on the site (i.e. search, ad se- lection and delivery, event logging) have presented technical re- quirements drastically outside the scope of the LAMP framework. In our implementation of these services, various programming lan- guages have been selected to optimize for the right combination of performance, ease and speed of development, availability of exist- ing libraries, etc. By and large, Facebook’s engineering culture has tended towards choosing the best tools and implementations avail- able over standardizing on any one programming language and be- grudgingly accepting its inherent limitations. Given this design choice, we were presented with the challenge of building a transparent, high-performance bridge across many programming languages. We found that most available solutions were either too limited, did not offer sufficient datatype freedom, or suffered from subpar performance. 1 The solution that we have implemented combines a language- neutral software stack implemented across numerous programming languages and an associated code generation engine that trans- forms a simple interface and data definition language into client and server remote procedure call libraries. Choosing static code generation over a dynamic system allows us to create validated code that can be run without the need for any advanced introspec- tive run-time type checking. It is also designed to be as simple as possible for the developer, who can typically define all the neces- sary data structures and interfaces for a complex service in a single short file. Surprised that a robust open solution to these relatively common
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/31/2008 for the course CS 145 taught by Professor Widom during the Fall '99 term at Stanford.

Page1 / 8

Thrift Protocol (Facebook) - Thrift Scalable Cross-Language...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online