Database Reference
In-Depth Information
wanted to provide a client layer that is more active and receives more attention. Thrift is cur-
rently in version 0.2, with no release since 2009, and there is precious little documentation.
It is not clear at the time of this writing how long Thrift will be supported in addition to Avro;
they're both in the now-current tree. Because it is currently unclear which will ultimately be sup-
ported, I've included a little about them both here.
Thrift
Thrift is the driver-level interface; it provides the API for client implementations in a wide vari-
ety of languages. Thrift was developed at Facebook and donated as an Apache project with In-
cubator status in 2008. It's available at http://incubator.apache.org/thrift , though you don't need
to download it separately to use Cassandra.
Thrift is a code generation library for clients in C++, C#, Erlang, Haskell, Java, Objective
C/Cocoa, OCaml, Perl, PHP, Python, Ruby, Smalltalk, and Squeak. Its goal is to provide an easy
way to support efficient RPC calls in a wide variety of popular languages, without requiring the
overhead of something like SOAP.
To use it, you create a language-neutral service definition file that describes your data types and
service interface. This file is then used as input into the engine that generates RPC client code
libraries for each of the supported languages. The effect of the static generation design choice is
that it is very easy for the developer to use, and the code can perform efficiently because valida-
tion happens at compile time instead of runtime.
NOTE
You can read the full paper that describes the Thrift implementation, written by its creators, at ht-
tp://incubator.apache.org/thrift/static/thrift-20070401.pdf .
The design of Thrift offers the following features:
Language--independent t
t types
Because types are defined in a language-neutral manner using the definition file, they can
be shared between different languages. For example, a C++ struct can be exchanged with a
Python dictionary.
Common t
n transport i
t intterface
The same application code can be used whether you are using disk files, in-memory data, or
a streaming socket.
Search WWH ::




Custom Search