• Like
  • Save
Practical SOA with Thrift
Upcoming SlideShare
Loading in...5

Practical SOA with Thrift



Introductory slides on Apache Thrift

Introductory slides on Apache Thrift



Total Views
Views on SlideShare
Embed Views



3 Embeds 205

http://www.maciejmroz.com 196
http://www.linkedin.com 8
https://www.linkedin.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Practical SOA with Thrift Practical SOA with Thrift Presentation Transcript

    • Practical SOA with Thriftby Maciej Mrózwww.maciejmroz.com@maciejmrozCTO, Ganymedewww.ganymede.eu
    • The buzzword● It is a buzzword :)● Decodes to Service Oriented Architecture but ...● Its NOT a standard● Its NOT a technology● So what is it, really?
    • SOA● An approach to distributed application Architecture● Loosely coupled, reusable Services● Not something you buy or switch on, its something you do.
    • Services are independent!● Reuse through mashups
    • Encapsulation● You dont know whats inside - thats good
    • Operations made easier● Security, scalability, disaster recovery, capacity planning …● Monitoring ● Subset of tests run by CI server? ● Strong case for DevOps approach
    • Development made easier● Interoperability ● pick the best tool for the job ● legacy systems can be retired with little risk● Reduced code complexity (locally)● Per-service release cycle ● no huge “anything can go bad” releases● Easier testing
    • Implementation● SOAP – not really Simple …● Its friends are worse: Source - Flickr
    • How about REST?● No such thing as REST standard● Whats the data format? XML, JSON, other?● Wheres the service contract?● Tied to HTTP● Not a bad choice, probably best for externally facing APIs ● Google, Amazon etc
    • Thrift● Apache project, open sourced by Facebook in 2007● Platform and language independent● Services defined with custom IDL● Complete framework, just write your business logic!● Easy to use
    • Architecture● Flexible transport and protocol layers● Transports: file, memory, TCP, zlib (wrapper) ...● Protocols: binary, JSON, debug (human readable) … Source - Wikipedia
    • Servers● TSimpleServer – “testing server”● TThreadPoolServer● TNonblockingServer● TProcessPoolServer ● Works around Python threading issues● Others● Run benchmarks!
    • IDL Basics● Basic types: bool, byte, i16, i32, i64, double, string● Enums● Containers: list, set, map● Bind to natural types (i.e. std::vector in C++ but List in Java● #include
    • Structures● Nesting is ok● Optional fields - backward compatibility tool● No inheritance!
    • Services● One way methods via oneway keyword● Exceptions
    • Putting it all together● Write the IDL file● Use thrift compiler ● thrift --gen py interface.thrift● Write your service ● This doesnt happen automatically :)● Use generated client code ● Generate other clients as needed
    • Example – Nonblocking C++ server
    • Python client
    • Demo!
    • Questions
    • Thank you!