Bobcares

Apache Thrift

by | May 11, 2011

Using Facebook all the time nowadays? Have you ever wondered how this user friendly yet innovative site has been made ? Do they use Java, C++ or Python for coding purpose?

The answer is – “Thrift”, now called “Apache Thrift”.

From its home page:
Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between multiple programming languages.

So it basically allows us to write a code and then implement it in various other languages. Thrift has been written in C++ and it supports the following languages.
——————————————-
C++
C#
Erlang
Haskell
Java
Objective C/Cocoa
OCaml
Perl
PHP
Python
Ruby
Squeak

——————————————-

How Thrift works

1. We write files with .thrift extension in which we declare data (such as objects and procedure) which are to be passed between applications running on different languages.

2. Then we build the .thrift files for the language of our choice. For example, server side programming can be done with Java and client side programming using PHP.

3. Then create server and client side applications using the code generated above. Then the client should call for a procedure which has been implemented in the server side code and declared in thrift files.

4. At last you need to start the server and use client scripts to perform the actions.

Thinking where to use Thrift?

Thrift can be used when your application relies on the client-server model. Also if you believe(as Facebook did), that some applications run better on some languages and you cannot to stick to one language for all your purpose.

Best of all, Thrift has been presented to open source community in April 2007 and entered the Apache Incubator in May, 2008. So now you can implement this on your server application.

It is possible to install Thrift on both Linux (CentOS and Ubuntu) and Windows. Though fairly simple to install, there are few GOTCHAS you need to be careful with while installing.

Bobcares helps online businesses maintain reliable, feature-rich web services. Apache Thrift is a new addition to our list of supported technologies in our web server management services. If you want to know more about setting up or maintaining an Apache Thrift server, we’d be happy to talk to you.


About the Author

It has been four months and some odd days since Vicky Karmakar joined the Poornam family.
A graduate of Information Technology branch, Vicky has always been interested in exploring the newer ventures of the Open source technology with an acute inclination towards network security. He also harbors a passion towards writing poetry and cooking culinary delicacies.


Co-Authored by Sankar H

2 Comments

  1. Dinesh k

    Nice..:-)

  2. Debojit Sinha

    Concise, yet informative. Well written.

Never again lose customers to poor
server speed! Let us help you.