Thrift Protocol (Facebook)

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

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

Thrift: Scalable Cross-Language Services Implementation Mark Slee, Aditya Agarwal and Marc Kwiatkowski Facebook, 156 University Ave, Palo Alto, CA { mcslee,aditya,marc } 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 problems did not yet exist, we committed early on to making the Thrift implementation open source.
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern