SlideShare a Scribd company logo
1 of 20
Download to read offline
Apache Thrift
One Stop Solution for Cross Language Communication



                 Piyush Goel
            Capillary Technologies
           piyush.goel@capillary.co.in
Problem Statement




                ??????????????????




                  SMS




07/07/11
Solutions ??

  SOAP : Do we really need to parse so much XML ?


  COM : Works only for windows


  Protocol Buffers:
      Does not support RPC out of the box
      Mainly focussed on serialization and deserialization


  MessagePack:
      Well, It wasn’t popular enough when the system was designed.




07/07/11
Problem




                     THRIFT




07/07/11
Thrift

      Remote Procedural Call (RPC) Framework for developing scalable cross
      language services.


      Developed by Facebook, Open sourced in April 2007


      Entered Apache Inbubation in May 2008


      Current Version 0.6


      Supported Languages : C++, Java, Python, PHP, Ruby, Erlang, Perl,
                            Haskell, C#, Cocoa, JavaScript, Node.js,
                            Smalltalk, Squeak, OCaml



  07/07/11
Components


   Type System
    Generic Type System compatible with all languages.
   Transport Layer
     Actual data transfer over stream sockets/HTTP etc.
   Protocol Layer
     Encoding/Decoding of data types
   Processors
     Encapsulates logic of reading/writing to input/output streams
   Server
    Wrapper over all above layers for the server end



07/07/11
Type System

  Define your data types in a Thrift Interface Description File

 Base Types:
        bool
        byte
        Integers: i16, i32, i64
        double
        string
 Structs : C style structures
 Containers: List, Set, Map
 Exceptions: Basically structs
 Services: Interfaces defining the remote methods. Equivalent to an
                             abstract class


 07/07/11
Transport Layer

     Abstracts out the logic of reading/writing over the communication
     layer through Interfaces
     Decouples the remaining system from nitty-gritty of raw data transfer
     TTransport Interface :
            open, close, isOpen, read, write, flush
     TServerTransport Interface:
            open, listen, accept, close
     Available Implementation :
            TSocket, TFileTransport, TFramedTransport,
            TBufferedTransport, TServerSocket etc




 07/07/11
Protocol Layer

  Abstracts out the serialization and deserialization of data types
  Exposes read/write methods for all data types
  Implementations:
      Binary
      Compact
      JSON
      Plain Text, XML




07/07/11
Processor and Server
    TProcesser interface handles the reading and writing of data
    through TProtocol objects.
    Invokes the user implemented handlers for remote methods


Server:
Encapsulates all the above layers:
           Creates transport
           Creates protocols for the transport
           Creates a processor based on the input/output protocols
           Listen for incoming connections and pass them to the
           processor
           TSimpleServer, TThreadedServer, TThreadPoolServer


07/07/11
The Whole Flow




07/07/11
Thrift at Capillary

Dynamic Vouchers

    LAMP based server
    Java Based Business Rule Engine
    Over 1000 rules to be processed on every transaction
    Prioritization/Selection of the vouchers generated
    Thrift for PHP-JAVA communication.
        TSocket
        TBinary
        TThreadedServer
    25-30 RPS during peak time




 07/07/11
Thrift at Capillary
SMS Engine:
Transactional SMS:
       “Hello Mr. Sharma, thanks for shopping at our store today. You have been
       awarded 100 points. “
       PHP web-service / Java based sms sending engine.
       Thrift for PHP-Java communication


  Promotional:
       Sends out personalized SMS to customers
       “Hello Mr Shahrukh Khan, its been 3 months since you visited
        our MG Road outlet. Hoping to see you soon !!”
       On average ~1.5-2 MM SMS per day
       Java based system for message generation/template replacement
       Java based system to send messages to gateway.
       Java – Java communication over thrift.


 07/07/11
References


1) Thrift Whitepaper: http://thrift.apache.org/static/thrift-
   20070401.pdf
2) http://en.wikipedia.org/wiki/Apache_Thrift
3) Thrift: The Missing Guide:
   http://diwakergupta.github.com/thrift-missing-guide/
4) http://chanian.com/2010/05/13/thrift-tutorial-a-php-client/
5) http://mikecvet.wordpress.com/2010/05/13/apache-thrift-
   tutorial-the-sequel/




 07/07/11
Questions


07/07/11
07/07/11
Which of the following languages Thrift does not
 support ?
      1) SmallTalk
      2) Squeak
      3) C
      4) Objective-C




07/07/11
Which interface implementation is responsible for
 managing incoming connections on the Server in Thrift ?
1) TProtocol
2) TProcesser
3) TTransport
4) TServer




07/07/11
Which of the following projects is/are using Thrift internally?
1) HBase
2) HyperTable
3) Voldemort
4) Cassandra




07/07/11
We are Hiring !!!


           career-tech@capillary.co.in
           piyush.goel@capillary.co.in
               http://capillary.co.in




07/07/11

More Related Content

What's hot

Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonIgor Anishchenko
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantarIndicThreads
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHBhavsingh Maloth
 
jkljklj
jkljkljjkljklj
jkljkljhoefo
 
web Based Application Devlopment using PHP
web Based Application Devlopment using PHPweb Based Application Devlopment using PHP
web Based Application Devlopment using PHPmaccodder
 
Build Your Own Tools
Build Your Own ToolsBuild Your Own Tools
Build Your Own ToolsShugo Maeda
 
Data Serialization Using Google Protocol Buffers
Data Serialization Using Google Protocol BuffersData Serialization Using Google Protocol Buffers
Data Serialization Using Google Protocol BuffersWilliam Kibira
 
XML-RPC (XML Remote Procedure Call)
XML-RPC (XML Remote Procedure Call)XML-RPC (XML Remote Procedure Call)
XML-RPC (XML Remote Procedure Call)Peter R. Egli
 

What's hot (20)

Apache Thrift
Apache ThriftApache Thrift
Apache Thrift
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantar
 
3 apache-avro
3 apache-avro3 apache-avro
3 apache-avro
 
Protocol Buffer.ppt
Protocol Buffer.pptProtocol Buffer.ppt
Protocol Buffer.ppt
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
 
Thrift
ThriftThrift
Thrift
 
Php intro
Php introPhp intro
Php intro
 
jkljklj
jkljkljjkljklj
jkljklj
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
web Based Application Devlopment using PHP
web Based Application Devlopment using PHPweb Based Application Devlopment using PHP
web Based Application Devlopment using PHP
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Reversing Google Protobuf protocol
Reversing Google Protobuf protocolReversing Google Protobuf protocol
Reversing Google Protobuf protocol
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
Web design EJ3
Web design    EJ3Web design    EJ3
Web design EJ3
 
Build Your Own Tools
Build Your Own ToolsBuild Your Own Tools
Build Your Own Tools
 
Servlet basics
Servlet basicsServlet basics
Servlet basics
 
Data Serialization Using Google Protocol Buffers
Data Serialization Using Google Protocol BuffersData Serialization Using Google Protocol Buffers
Data Serialization Using Google Protocol Buffers
 
XML-RPC (XML Remote Procedure Call)
XML-RPC (XML Remote Procedure Call)XML-RPC (XML Remote Procedure Call)
XML-RPC (XML Remote Procedure Call)
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
 

Viewers also liked

Thrfit从入门到精通
Thrfit从入门到精通Thrfit从入门到精通
Thrfit从入门到精通炜龙 何
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Accenture
 
Hive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamHive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamZheng Shao
 
Mongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDMongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDJin wook
 
Hive Object Model
Hive Object ModelHive Object Model
Hive Object ModelZheng Shao
 
아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) 아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) Jin wook
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecturemysqlops
 
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...Amazon Web Services
 
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.Rishikese MR
 
Data Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRData Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRAmazon Web Services
 
Facebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challengeFacebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challengeCristina Munoz
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenHARMAN Services
 
Best Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSBest Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSAmazon Web Services
 

Viewers also liked (16)

Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
Thrfit从入门到精通
Thrfit从入门到精通Thrfit从入门到精通
Thrfit从入门到精通
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
 
Hive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive TeamHive User Meeting March 2010 - Hive Team
Hive User Meeting March 2010 - Hive Team
 
Mongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUDMongo DB로 진행하는 CRUD
Mongo DB로 진행하는 CRUD
 
Hive Object Model
Hive Object ModelHive Object Model
Hive Object Model
 
아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift) 아파치 쓰리프트 (Apache Thrift)
아파치 쓰리프트 (Apache Thrift)
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
 
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
AWS re:Invent 2016: Deep Dive: Amazon EMR Best Practices & Design Patterns (B...
 
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
 
Data Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMRData Science & Best Practices for Apache Spark on Amazon EMR
Data Science & Best Practices for Apache Spark on Amazon EMR
 
Facebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challengeFacebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challenge
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it Open
 
Best Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWSBest Practices for Using Apache Spark on AWS
Best Practices for Using Apache Spark on AWS
 

Similar to Apache Thrift : One Stop Solution for Cross Language Communication

Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009jarfield
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureMuhammad Ali
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniVMware Tanzu
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKXMike Willbanks
 
RestMS Introduction
RestMS IntroductionRestMS Introduction
RestMS Introductionpieterh
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)NYversity
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with phpElizabeth Smith
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleTim Burks
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentationTim Taplin
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsTim Burks
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systemsdairsie
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniquesguest8899ec02
 
Sending mail,web services
Sending mail,web servicesSending mail,web services
Sending mail,web servicesDevang Patel
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in LispVladimir Sedach
 

Similar to Apache Thrift : One Stop Solution for Cross Language Communication (20)

Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009HornetQ Presentation On JBoss World 2009
HornetQ Presentation On JBoss World 2009
 
Jbw chicago
Jbw chicagoJbw chicago
Jbw chicago
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
RestMS Introduction
RestMS IntroductionRestMS Introduction
RestMS Introduction
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with php
 
Simrat Resume
Simrat ResumeSimrat Resume
Simrat Resume
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
 
Webtechnologies
Webtechnologies Webtechnologies
Webtechnologies
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentation
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniques
 
Sending mail,web services
Sending mail,web servicesSending mail,web services
Sending mail,web services
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

Apache Thrift : One Stop Solution for Cross Language Communication

  • 1. Apache Thrift One Stop Solution for Cross Language Communication Piyush Goel Capillary Technologies piyush.goel@capillary.co.in
  • 2. Problem Statement ?????????????????? SMS 07/07/11
  • 3. Solutions ?? SOAP : Do we really need to parse so much XML ? COM : Works only for windows Protocol Buffers: Does not support RPC out of the box Mainly focussed on serialization and deserialization MessagePack: Well, It wasn’t popular enough when the system was designed. 07/07/11
  • 4. Problem THRIFT 07/07/11
  • 5. Thrift Remote Procedural Call (RPC) Framework for developing scalable cross language services. Developed by Facebook, Open sourced in April 2007 Entered Apache Inbubation in May 2008 Current Version 0.6 Supported Languages : C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, Squeak, OCaml 07/07/11
  • 6. Components Type System Generic Type System compatible with all languages. Transport Layer Actual data transfer over stream sockets/HTTP etc. Protocol Layer Encoding/Decoding of data types Processors Encapsulates logic of reading/writing to input/output streams Server Wrapper over all above layers for the server end 07/07/11
  • 7. Type System Define your data types in a Thrift Interface Description File Base Types: bool byte Integers: i16, i32, i64 double string Structs : C style structures Containers: List, Set, Map Exceptions: Basically structs Services: Interfaces defining the remote methods. Equivalent to an abstract class 07/07/11
  • 8. Transport Layer Abstracts out the logic of reading/writing over the communication layer through Interfaces Decouples the remaining system from nitty-gritty of raw data transfer TTransport Interface : open, close, isOpen, read, write, flush TServerTransport Interface: open, listen, accept, close Available Implementation : TSocket, TFileTransport, TFramedTransport, TBufferedTransport, TServerSocket etc 07/07/11
  • 9. Protocol Layer Abstracts out the serialization and deserialization of data types Exposes read/write methods for all data types Implementations: Binary Compact JSON Plain Text, XML 07/07/11
  • 10. Processor and Server TProcesser interface handles the reading and writing of data through TProtocol objects. Invokes the user implemented handlers for remote methods Server: Encapsulates all the above layers: Creates transport Creates protocols for the transport Creates a processor based on the input/output protocols Listen for incoming connections and pass them to the processor TSimpleServer, TThreadedServer, TThreadPoolServer 07/07/11
  • 12. Thrift at Capillary Dynamic Vouchers LAMP based server Java Based Business Rule Engine Over 1000 rules to be processed on every transaction Prioritization/Selection of the vouchers generated Thrift for PHP-JAVA communication. TSocket TBinary TThreadedServer 25-30 RPS during peak time 07/07/11
  • 13. Thrift at Capillary SMS Engine: Transactional SMS: “Hello Mr. Sharma, thanks for shopping at our store today. You have been awarded 100 points. “ PHP web-service / Java based sms sending engine. Thrift for PHP-Java communication Promotional: Sends out personalized SMS to customers “Hello Mr Shahrukh Khan, its been 3 months since you visited our MG Road outlet. Hoping to see you soon !!” On average ~1.5-2 MM SMS per day Java based system for message generation/template replacement Java based system to send messages to gateway. Java – Java communication over thrift. 07/07/11
  • 14. References 1) Thrift Whitepaper: http://thrift.apache.org/static/thrift- 20070401.pdf 2) http://en.wikipedia.org/wiki/Apache_Thrift 3) Thrift: The Missing Guide: http://diwakergupta.github.com/thrift-missing-guide/ 4) http://chanian.com/2010/05/13/thrift-tutorial-a-php-client/ 5) http://mikecvet.wordpress.com/2010/05/13/apache-thrift- tutorial-the-sequel/ 07/07/11
  • 17. Which of the following languages Thrift does not support ? 1) SmallTalk 2) Squeak 3) C 4) Objective-C 07/07/11
  • 18. Which interface implementation is responsible for managing incoming connections on the Server in Thrift ? 1) TProtocol 2) TProcesser 3) TTransport 4) TServer 07/07/11
  • 19. Which of the following projects is/are using Thrift internally? 1) HBase 2) HyperTable 3) Voldemort 4) Cassandra 07/07/11
  • 20. We are Hiring !!! career-tech@capillary.co.in piyush.goel@capillary.co.in http://capillary.co.in 07/07/11