Why Apache Thrift?
Thrift is an interface definition language (IDL) and binary communication protocol. It is used as a RPC framework, which was developed by Facebook and now maintained as an open source project by Apache Software Foundation.
Thrift is used by many popular projects such as Facebook, Hadoop, Cassendra, HBase, Hypertable.
Why Thrift over JSON?
Thrift is Lightweight, Language Independent and support Data Transport/ Serialization to build cross language services.
1) Strong Typing
Performance is one of Thrift’s main design considerations. JSON is much more geared towards human readability, which comes at the cost of making them more CPU intensive to work with.
If you are serializing large amounts of data, Thrift’s binary protocol is more efficient than JSON.
4) Versioning Support
Thrift has inbuilt mechanisms for versioning data. This can be very helpful in a distributed environment where your service interfaces may change, but you cannot atomically update all your client and server code.
5) Server Implementaion
Thrift includes RPC server implementations for a number of languages. Because they are streamlined to just support Thrift requests, they are lighter-weight and higher-performance than typical HTTP server implementations like JSON.
It is more work to get started on the client side, when the clients are directly building the calling code. It’s less work for the service owner if they are building libraries for clients. The bottom line: If you are providing a simple service & API, Thrift is probably not the right tool.
1. Thrift Tutorial - http://thrift-tutorial.readthedocs.org/en/latest/intro.html
2. The programmers guide to Apache Thrift (MEAP) – Chapter 01
3. Writing your first Thrift Service - http://srinathsview.blogspot.com/2011/09/writing-your-first-thrift-service.html
Comments are closed.