Thrift与协议缓冲区 [英] Thrift vs Protocol buffers
问题描述
我一直在使用PB一段时间,但是,Thrift一直在我的脑海里。
I've been using PB for quite a while now, but, Thrift has constantly been at the back of my mind.
节俭的主要优点,我看到的是:
The primary advantages of thrift, as I see it are:
- 本地集合(即向量,集合等)vs PBs重复提供类似的功能,没有迭代器,除非你深入到RepeatedField,文档声明在大多数情况下不应该需要)。
- 提供了一个体面的RPC实现,而不是只钩住你自己的插件。
- 更多官方支持的语言(PB为Java,C ++,Python提供官方支持)
Thrift的缺点:
The cons of Thrift:
- RPC实现意味着我无法插入我自己的(例如)加密/
- Windows支持似乎不是很好。
- PB似乎有更好的文档。 li>
- The RPC implementation means I can't plug in my own (for example) encryption/authentication layer on top.
- Windows support doesn't seem to be great.
- PB definitely seems to have, if not better, more accessible documentation.
中立:
- 未知大小的.lib /.dll> Windows
- Windows上的.lib大小(PB,但它确实提供了一个显着更小的-lite)。
- 速度明显,他们似乎都是相似的。
我还没有准备好接受切换Thrift仍然,任何人都可以给我更多的优点/缺点,或理由去一种方式或其他?
I'm not quite ready to take the plunge and switch to Thrift yet, can anyone offer me more pros/cons, or reasons to go one way or the other?
谢谢!
推荐答案
正如我所说的Thrift与协议缓冲区的最大区别?主题:
As I've said as "Biggest differences of Thrift vs Protocol Buffers?" topic :
引用 Thrift vs Protobuf vs JSON比较:
- 在Protobuf和Thrift中支持C ++,Python和Java。
- Protobuf对其他语言(包括Lua,Matlab,Ruby,Perl,R,Php,OCalm,Mercury,Erlang,Go,D,Lisp)的支持可用作第三方插件 。 这里是SWI-Prolog支持)。
- Protobuf
- Protobuf对象较小
- 取消发送optimize_for = SPEED时,Protobuf的速度更快 b $ b
- Thrift集成了RPC实现,而对于 Protobuf RPC解决方案,它们是分开的,但可用 (如 Zeroc ICE )。
- Protobuf是根据BSD样式许可发布的
- Thrift是根据Apache许可证发布的
- C++, Python, Java - in-box support in Protobuf and Thrift.
- Protobuf support for other languages (including Lua, Matlab, Ruby, Perl, R, Php, OCalm, Mercury, Erlang, Go, D, Lisp) is available as Third Party Addons (btw. Here is SWI-Prolog support).
- Protobuf has much better documentation and plenty of examples.
- Protobuf objects are smaller
- Protobuf is faster when unsing "optimize_for = SPEED"
- Thrift has integrated RPC implementation, while for Protobuf RPC solutions are separated, but available (like Zeroc ICE ).
- Protobuf is released under BSD-style license
- Thrift is released under Apache license
此外,还有许多有趣的额外工具可用于这些解决方案,这可能决定。以下是Protobuf的示例: Protobuf-wireshark , protobufeditor 。
Additionally, there are plenty of interesting additional tools available for those solutions, which might decide. Here are examples for Protobuf: Protobuf-wireshark , protobufeditor.
这篇关于Thrift与协议缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!