When comparing Apache Thrift vs Protocol Buffers, the Slant community recommends Protocol Buffers for most people. In the question“What are the best data serialization frameworks?” Protocol Buffers is ranked 1st while Apache Thrift is ranked 2nd. The most important reason people chose Protocol Buffers is:
Unlike JSON and XML, because data is exchanged in binary, there is little to no parsing overhead, resulting in significant performance gains.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Open Source
Although it was initially developed by Facebook, it's now open source under the Apache License.
Pro Simple Interface Definition Language (IDL)
The IDL for Thrift looks quite similar to JSON / is comfortably human readable.
Pro Includes built in language bindings for most popular languages
The current list includes C, C++, C#, Java, Python, PHP, Perl, Ruby and quite a few others.
Pro Easy to read definition files
Considering that Thrift's WSDL documents tend to be smaller and more straightforward means that it has easy to read definition files.
Pro No parsing overhead
Unlike JSON and XML, because data is exchanged in binary, there is little to no parsing overhead, resulting in significant performance gains.
Pro Reliable
As this technology's been used behind the scenes by Google for over 10 years, their native libraries can be considered highly robust.
Pro Open source
It's free, open source and licensed under BSD-3
Pro Composite type extensions
A range of addresses can be declared as available without further definition. This allows third parties to use these spare fields for their custom requirements.
Pro Third party support for multiple programming languages
Supports multiple programming languages via third party solutions.
Pro Not widely adopted
If you hope to present your services to other companies this may be a drawback. REST (and "pseudo-rest" variants) has become the de-facto choice, with SOAP a close second. This means anyone connecting to your services would need to familiarise themselves with a new method of communication, and that they are less likely to have an existing toolset for such integrations built into their systems.
Pro Versioning
The protocol includes versioning, allowing clients on older versions of code to continue to communicate with an upgraded server (i.e. clients and servers don't need to be upgraded in unison).
Cons
Con Binds communication logic to Business logic
Cannot abstract api functionality/data to edge cases in distributed architecture. Instead uses localized api pattern.
Con Doesn't natively support objects inheritance
