Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Architecture  





2 See also  





3 References  





4 External links  














Apache Thrift






Deutsch
فارسی
Français

Italiano

Polski
Русский

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

(Redirected from Thrift (protocol))

Apache Thrift
Original author(s)Facebook, Inc.
Developer(s)Apache Software Foundation
Stable release

0.19.0 / 2 September 2023; 10 months ago (2023-09-02)[1]

RepositoryThrift repository
Written inActionScript, C, C#, C++, D, Dart, Delphi, Erlang, Go, Haskell, Haxe, Java, JavaScript, Node.js, OCaml, Perl, PHP, Python, Rust, Scala, Smalltalk
TypeRemote procedure call framework
LicenseApache 2.0
Websitethrift.apache.org

Thrift is an IDL (Interface Definition Language) and binary communication protocol[2] used for defining and creating services for programming languages.[3] It was developed by Facebook. Since 2020, it is an open source project in the Apache Software Foundation.

It uses a remote procedure call (RPC) framework and combines a software stack with a code generation engine to build cross-platform services. Thrift can connect applications written in a variety of languages and frameworks, including ActionScript, C, C++,[4] C#,[5] Cocoa, Delphi, Erlang, Go, Haskell, Java, JavaScript, Objective-C, OCaml, Perl, PHP, Python, Ruby, Elixir, Rust, Scala, Smalltalk, and Swift.[6] The implementation was described in an April 2007 technical paper released by Facebook, now hosted on Apache.[7][8]

Architecture

[edit]
The Apache Thrift API client/server architecture

Thrift includes a complete stack for creating clients and servers.[9] The top part is generated code from the Thrift definition. From this file, the services generate client and processor codes. In contrast to built-in types, created data structures are sent as a result of generated code. The protocol and transport layer are part of the runtime library. With Thrift, it is possible to define a service and change the protocol and transport without recompiling the code. Besides the client part, Thrift includes server infrastructure such as blocking, non-blocking, and multi-threaded servers. The underlying I/O part of the stack is implemented differently for different programming languages.[9]

Thrift supports a number of protocols:[9]

The supported transports are:

Thrift also provides a number of servers, which are:

Thrift is written in C++, but can create code for some other programming languages. To create a Thrift service, one has to write Thrift files that describe it, generate the code in the destination language, write some code to start the server, and call it from the client. An example of such a description file:

enum PhoneType {
  HOME,
  WORK,
  MOBILE,
  OTHER
}

struct Phone {
  1: i32 id,
  2: string number,
  3: PhoneType type
}

service PhoneService {
  Phone findById(1: i32 id),
  list<Phone> findAll()
}

Thrift will generate the code out of this descriptive information. For instance, in Java, the PhoneType will be enum inside the Phone class.

See also

[edit]
  • Apache Avro
  • Abstract Syntax Notation One (ASN.1)
  • Hessian
  • Protocol Buffers
  • External Data Representation (XDR)
  • Internet Communications Engine (Ice)
  • gRPC
  • SDXF
  • References

    [edit]
    1. ^ "Apache Thrift - Downloads". Retrieved January 6, 2024.
  • ^ "Installing and using Apache Cassandra With Java Part 4 (Thrift Client)". Sodeso – Software Development Solutions. Archived from the original on March 31, 2022. Retrieved March 30, 2011. Thrift is a separate Apache project which is a binary communication protocol
  • ^ Prunicki, Andrew. "Apache Thrift: Introduction". Object Computing. Archived from the original on July 23, 2011. Retrieved April 11, 2011. Using code generation, Thrift creates a set of files which can then be used for creating clients and/or servers.
  • ^ "ThriftRequirements". Apache Software Foundation. Archived from the original on February 26, 2024. Retrieved June 22, 2024.{{cite web}}: CS1 maint: unfit URL (link)
  • ^ Fred Potter, Using Thrift with Cappuccino Archived 2011-08-12 at the Wayback Machine, parallel48's posterously luscious blog, 10 June 2010.
  • ^ Andrew Prunicki. "Apache Thrift: Code Generation". Object Computing. Archived from the original on July 23, 2011. Retrieved April 12, 2011.
  • ^ Mark Slee, Aditya Agarwal, Marc Kwiatkowski, Thrift: Scalable Cross-Language Services Implementation
  • ^ "LibraryFeatures". Apache Software Foundation. July 11, 2019. Archived from the original on May 3, 2024. Retrieved April 21, 2016.
  • ^ a b c Andrew Prunicki. "Apache Thrift: Introduction". Object Computing. Archived from the original on July 23, 2011. Retrieved April 11, 2011.
  • ^ Skelton, Steven (August 3, 2013). "Developer Friendly Thrift Request Logging". stevenskelton.ca. Archived from the original on January 24, 2024. Retrieved July 3, 2014.
  • [edit]
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Apache_Thrift&oldid=1236677277"

    Categories: 
    Apache Software Foundation projects
    Application layer protocols
    Data serialization formats
    Inter-process communication
    Remote procedure call
    Facebook software
    Hidden categories: 
    CS1 maint: unfit URL
    Webarchive template wayback links
    Use mdy dates from June 2024
    Articles with short description
    Short description is different from Wikidata
    Articles with a promotional tone from August 2019
    All articles with a promotional tone
    Wikipedia articles with style issues from August 2019
    All articles with style issues
    Articles with multiple maintenance issues
    Official website different in Wikidata and Wikipedia
     



    This page was last edited on 26 July 2024, at 00:45 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki