为什么Kafka是基于拉动而不是基于推挤? [英] Why is Kafka pull-based instead of push-based?

查看:32
本文介绍了为什么Kafka是基于拉动而不是基于推挤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Kafka是基于推式而不是基于推式?我同意Kafka提供了我所经历的高吞吐量,但是我不知道如果将其推入基础,Kafka吞吐量将如何下降.关于基于推的方式如何降低性能的任何想法?

Why is Kafka pull-based instead of push-based? I agree Kafka gives high throughput as I had experienced it, but I don't see how Kafka throughput would go down if it were to pushed based. Any ideas on how push-based can degrade performance?

推荐答案

可扩展性是我们设计此类系统(拉动与推动)时的主要驱动因素.Kafka具有很好的可扩展性.Kafka的主要优点之一是,在不影响性能和不造成停机的情况下,很容易添加大量消费者.

Scalability was the major driving factor when we design such systems (pull vs push). Kafka is very scalable. One of the key benefits of Kafka is that it is very easy to add large number of consumers without affecting performance and without down time.

Kafka可以以每秒100k +的速度处理来自生产者的事件.由于Kafka使用者从主题中提取数据,因此不同的使用者可以以不同的速度消费消息. Kafka还支持不同的消费模型.您可以让一个使用者实时处理消息,而让另一个使用者以批处理模式处理消息.

Kafka can handle events at 100k+ per second rate coming from producers. Because Kafka consumers pull data from the topic, different consumers can consume the messages at different pace. Kafka also supports different consumption models. You can have one consumer processing the messages at real-time and another consumer processing the messages in batch mode.

另一个原因可能是Kafka不仅是为像Hadoop这样的单一消费者设计的.不同的消费者可以有不同的需求和能力.

The other reason could be that Kafka was designed not only for single consumers like Hadoop. Different consumers can have diverse needs and capabilities.

基于拉的系统存在一些缺陷,例如由于定期轮询而导致资源浪费.Kafka支持长时间轮询"等待模式,直到通过真实数据来缓解此缺点.

Pull-based systems have some deficiencies like resources wasting due to polling regularly. Kafka supports a 'long polling' waiting mode until real data comes through to alleviate this drawback.

这篇关于为什么Kafka是基于拉动而不是基于推挤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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