kafka和mqtt的区别和联系

参考:https://www.zhihu.com/question/30343125

两者虽然都是从传统的Pub/Sub消息系统演化出来的,但是进化的方向不一样,以下是几个比较突出的点:

  1. Kafka是为了数据集成的场景,与以往Pub/Sub消息总线不一样,通过分布式架构提供了海量消息处理、高容错的方式存储海量数据流、保证数据流的顺序等特性。可以参考云上的卡夫卡 - 数据工会
  2. MQTT是为了物联网场景而优化,不但提供多个QoS选项(exact once、at least once、at most once),而且还有层级主题、遗嘱等等特性。可以参考MQTT入门篇 - 数据工会

说白了都是传统消息系统(老爸)的子嗣,只是与不同的场景(老妈)结合的产物。不过,两者却可以结合起来使用。比如可以用MQTT接受物联网设备上传的数据,然后接入Kafka,最后可以同时分发到HDFS归档、数据仓库做OLAP分析、Elasticsearch做全文检索,这样的架构非常适合大型物联网项目,不但能够处理海量数据同时也具有很好的扩展性。

MQTT and Kafka, on paper, are publish/subscribe (pub/sub) messaging platforms. But a key distinction between the two relates to how they are put to use. Unlike Kafka, MQTT is a machine-to-machine (M2M) messaging protocol. This means that while Kafka is responsible for data management and ingestion into computation systems, MQTT specializes in data packet exchange between two physical devices. In our home automation example, if we want to adjust air conditioning according to ambient temperature, the temperature sensor must be able to communicate with the air conditioner. This communication is held through MQTT. As expected, MQTT is only intended for small-sized data sets, where responsiveness and power efficiency are prioritized. This doesn’t lend well to large data sets – the result being bad scaling. Kafka, on the other hand, is designed specifically with massive data feeds in mind. Sound IoT systems use Kafka and MQTT in conjunction, co-existing separately for maximum performance and scalability.

转载于:https://www.cnblogs.com/ryu-manager/p/9481201.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值