Thrift与协议缓冲区 [英] Thrift vs Protocol buffers

查看:168
本文介绍了Thrift与协议缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用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:


  1. 本地集合(即向量,集合等)vs PBs重复提供类似的功能,没有迭代器,除非你深入到RepeatedField,文档声明在大多数情况下不应该需要)。

  2. 提供了一个体面的RPC实现,而不是只钩住你自己的插件。

  3. 更多官方支持的语言(PB为Java,C ++,Python提供官方支持)

Thrift的缺点:

The cons of Thrift:


  1. RPC实现意味着我无法插入我自己的(例如)加密/

  2. Windows支持似乎不是很好。

  3. PB似乎有更好的文档。 li>
  1. The RPC implementation means I can't plug in my own (for example) encryption/authentication layer on top.
  2. Windows support doesn't seem to be great.
  3. 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比较

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆