taoCMS是基于php+sqlite/mysql的国内最小(100Kb左右)的功能完善的CMS管理系统

Thrift vs. Protocol Buffers

2012-01-07

Google recently released its Protocol Buffers as open source. About a year ago, Facebook released a similar product called Thrift. I’ve been comparing them; here’s what I’ve found:

 ThriftProtocol Buffers
BackersFacebook, Apache (accepted for incubation)Google
BindingsC++, Java, Python, PHP, XSD, Ruby, C#, Perl, Objective C, Erlang, Smalltalk, OCaml, and HaskellC++, Java, Python
(Perl, Ruby, and C# under discussion)
Output FormatsBinary, JSONBinary
Primitive Typesbool
byte
16/32/64-bit integers

double
string
byte sequence
map<t1,t2>
list<t>
set<t>

bool

32/64-bit integers
float
double
string
byte sequence

“repeated” properties act like lists

EnumerationsYesYes
ConstantsYesNo
Composite Typestructmessage
Exception TypeYesNo
DocumentationSo-soGood
LicenseApacheBSD-style
Compiler LanguageC++C++
RPC InterfacesYesYes
RPC ImplementationYesNo
Composite Type ExtensionsNoYes

Overall, I think Thrift wins on features and Protocol Buffers win on
documentation. Implementation-wise, they’re quite similar. Both use
integer tags to identify fields, so you can add and remove fields
without breaking existing code. Protocol Buffers support
variable-width encoding of integers, which saves a few bytes. (Thrift
has an experimental output format with variable-width ints.)

The major difference is that Thrift provides a full client/server RPC
implementation, whereas Protocol Buffers only generate stubs to use in
your own RPC system.

Update July 12, 2008: I haven’t tested for speed, but from a cursory examination it seems that, at the binary level, Thrift and Protocol Buffers are very similar. I think Thrift will develop a more coherent community now that it’s under Apache incubation. It just moved to a new web site and mailing list, and the issue tracker is active.

This entry was posted in Programming and tagged . Bookmark the permalink.

类别:未分组 | 阅读:236226 | 评论:0 | 标签:thrift protocol buffers

想收藏或者和大家分享这篇好文章→

“Thrift vs. Protocol Buffers”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

taoCMS发布taoCMS 3.0.2(最后更新21年03月15日),请大家速速升级,欢迎大家试用和提出您宝贵的意见建议。

捐助与联系

☟请使用新浪微博联系我☟

☟在github上follow我☟

标签云