encyclopegia.org

Apache Thrift

Thrift is an interface definition language and binary communication protocol used for defining and creating services for programming languages. It was developed by Facebook. Since 2008, 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++, C#, Cocoa, Delphi, Erlang, Go, Haskell, Java, JavaScript, Objective-C, OCaml, Perl, PHP, Python, Ruby, Elixir, Rust, Scala, Smalltalk, and Swift. The implementation was described in an April 2007 technical paper released by Facebook, now hosted on Apache.

Thrift is an interface definition language and binary communication protocol used for defining and creating services for programming languages. It was developed by Facebook. Since 2008, 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++, C#, Cocoa, Delphi, Erlang, Go, Haskell, Java, JavaScript, Objective-C, OCaml, Perl, PHP, Python, Ruby, Elixir, Rust, Scala, Smalltalk, and Swift. The implementation was described in an April 2007 technical paper released by Facebook, now hosted on Apache. ==Architecture== Thrift includes a complete stack for creating clients and servers. 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. Thrift supports a number of protocols: TBinaryProtocol – A binary format not optimized for space efficiency. Faster to process than the text protocol. TCompactProtocol – More compact binary format. TJSONProtocol – Uses JSON for the encoding of data. TSimpleJSONProtocol – A write-only protocol that cannot be parsed by Thrift because it drops metadata using JSON. Suitable for parsing by scripting languages. The supported transports are: TSimpleFileTransport – This transport writes to a file. TFramedTransport – This transport is required when using a non-blocking server. It sends data in frames, each preceded by length information. TMemoryTransport – Uses memory for I/O. The Java implementation uses a simple internally. TSocket – Uses blocking socket I/O for transport. TZlibTransport – Performs compression using zlib. Used in conjunction with another transport. Thrift also provides a number of servers, which are: TNonblockingServer – A multi-threaded server using non-blocking I/O (Java implementation uses NIO channels). TFramedTransport must be used with this server. TSimpleServer – A single-threaded server using standard blocking I/O. TThreadedServer – A multi-threaded server using a thread per connection model and standard blocking I/O. TThreadPoolServer – A multi-threaded server using a thread pool and standard blocking I/O. 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 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== Comparison of data serialization formats Apache Avro Abstract Syntax Notation One (ASN.1) Hessian Protocol Buffers External Data Representation (XDR) Internet Communications Engine (Ice) gRPC SDXF ==References== ==External links==

References

No reference rows published for this article.

Cite this article

MLA

"Apache Thrift." encyclopegia.org, 2026, https://encyclopegia.org/wiki/apache-thrift. Accessed 24 November 2026.

Chicago

"Apache Thrift." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/apache-thrift.

APA

encyclopegia.org. (2026). Apache Thrift. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/apache-thrift

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Apache Wave

stub · references available

Apache Ant

stub · references available

Apache Groovy

stub · references available

Apache Muse

stub · references available

Apache Tuscany

stub · references available

Apache Cayenne

stub · references available

Lipan Apache people

stub · references available

Plains Apache

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1376312348 · 0.5 · snapshot enwiki-001376312348

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.