Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Apache Thrift

Miha Rekar
February 17, 2015

Apache Thrift

Short tech talk I did for my coworkers on Apache Thrift and then later at my local Ruby User Group.

You can watch me present it here: https://www.youtube.com/watch?v=XnreZtC87do

Further read:
- Thrift Homepage:
 http://thrift.apache.org/
- Thrift the Missing Guide: 
http://diwakergupta.github.io/thrift-missing-guide/
- Ruby Conf 2013 - A Lightweight SOA Framework using Ruby, Apache Thrift and AMQP: 
https://www.youtube.com/watch?v=HTVoQ6_iVuc

Miha Rekar

February 17, 2015
Tweet

More Decks by Miha Rekar

Other Decks in Programming

Transcript

  1. APACHE THRIFT
    *thrift has no logo

    View full-size slide

  2. WHAT IS THRIFT?
    • language independent
    • binary communication protocol
    • interface definition language
    • code generator
    • service framework
    • Facebook -> Apache

    View full-size slide

  3. WHAT IS THRIFT?
    • language independent
    • binary communication protocol
    • interface definition language
    • code generator
    • service framework
    • Facebook -> Apache
    The Apache Thrift software framework, for
    scalable cross-language services
    development, combines a software stack
    with a code generation engine to build
    services that work efficiently and
    seamlessly between C++, Java, Python, PHP,
    Ruby, Erlang, Perl, Haskell, C#, Cocoa,
    JavaScript, Node.js, Smalltalk, OCaml and
    Delphi and other languages.

    View full-size slide

  4. INTERFACE DEFINITION LANGUAGE (IDL)
    • API specification
    • message specification
    • message validation
    • strongly typed
    • used to generate stubs and skeletons

    View full-size slide

  5. DATA STRUCTURES
    • Types: bool, byte, i16, i32, i64, double, string
    • Containers:
    • list - ordered list, may contain duplicates
    • set - unordered set of unique elements
    • map - map of unique keys of type t1 to values
    of type t2
    • Structs - grouping related items together - translate to
    classes

    View full-size slide

  6. THRIFT PROCESS
    • define a .thrift file (interface definition,
    types, services)
    • use a thrift compiler to generate our source
    code
    • add additional client/server functionality

    View full-size slide

  7. DEMO / TUTORIAL
    http://thrift.apache.org/tutorial/
    https://github.com/foursquare/twofishes/tree/master/
    interface/src/main/thrift

    View full-size slide

  8. FURTHER READ
    • Thrift Homepage:

    http://thrift.apache.org/
    • Thrift the Missing Guide:

    http://diwakergupta.github.io/thrift-missing-
    guide/
    • Ruby Conf 2013 - A Lightweight SOA Framework
    using Ruby, Apache Thrift and AMQP:

    https://www.youtube.com/watch?v=HTVoQ6_iVuc

    View full-size slide