问题描述
我知道Apache Thrift和ZeroMQ是属于不同类别的软件,并且做一个比较是不容易的,因为它是一个苹果到橙色的比较。但我不知道为什么他们属于不同的类别。他们是不是都用来在不同的服务之间传递数据,这可能是也可能不是用不同的语言写的?
I understand that Apache Thrift and ZeroMQ are softwares belonging to different categories, and it is not easy to do a comparison since it is an apple to orange comparison. But I don't know why they belong to different categories. Aren't they both used to pass data between different services, which may or may not be written in different languages?
我什么时候应该使用Thrift,消息队列?
When should I use Thrift and when should I use a message queue?
推荐答案
它们属于不同的类别,主要是因为它们针对具有不同关注的不同受众。因此,他们在不同的事情更好。
They belong to different categories primarily because they are targetted at different audiences with different concerns. Therefore they are better at different things.
类似于旨在提供高级别,合理抽象的方式在不同机器上的进程之间发送数据,可能在不同的语言。他们有意提供一个IDL-ish层来描述消息,可能带有自动或半自动版本控制和可选部分。
Apache Thrift similar to Google Protocol Buffers is intended to be high-level, reasonably well abstracted means to send data between processes on different machines, possibly in different languages. They purposefully provide an IDL-ish layer to describe the message, perhaps with automatic or semi-automatic versioning and optional sections.
,而不是一般的消息队列(这将是一个完全独立的问题),是关于速度。它们有效地将字节移动到另一端。沿着尽可能少的车站。因此,您有责任对开发人员进行序列化,版本控制或其他任何对您重要的操作。当然,这可能意味着复杂性,特别是如果你在不同平台和语言之间进行通信,但这是缺乏抽象的惩罚的一部分。
ZeroMQ specifically on the other hand, not message queues in general (which would be an entirely separate question), is all about speed. They efficiently move bytes to the other end. As few stops along the way as possible. As such, you are responsible for serialization, versioning, or whatever else is important to you the developer. Of course, this can mean complexity, particularly if you are communicating between different platforms and languages, but that's part of the penalty for lack of abstraction.
哪个选择?取决于您的项目。如果你不需要绝对的原始性能,更高级别的工具包可能会满足你的目的很好。
Which to choose? Depends on your project. If you don't need absolute raw performance, a higher level toolkit will likely serve your purpose just fine. If you are building a high-speed low-latency application, you're going to end up closer to the metal anyways.
祝你好运
这篇关于Apache Thrift和ZeroMQ之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!