卡夫卡可以配置为完全不保留吗?
Can Kafka be configured to not retain at all?
我对 Kafka 非常陌生,我正在研究 Kafka 是否可以用作实时消息传递代理而不是保留和发送。换句话说,它是否可以只做基本的 pub/sub 代理工作而根本不保留。
是否可以在 Kafka 服务器配置中进行配置?
我不认为这是可能的。 Kafka 和其他消息系统之间的主要区别之一是 Kafka 使用底层 OS 来处理存储。
Another unconventional choice that we made is to avoid explicitly
caching messages in memory at the Kafka layer. Instead, we rely on
the underlying file system page cache. Whitepaper
所以 Kafka 会自动将消息写入磁盘,因此它默认保留它们。这是 Kafka 的设计者做出的有意识的决定,他们认为这是值得权衡的。
如果您问这个问题是因为您担心写入磁盘可能比将内容保存在内存中慢。
We have found that both the production and the
consumption have consistent performance linear to the data size,
up to many terabytes of data. Whitepaper
因此,您保留的数据大小不会影响系统的速度。
我对 Kafka 非常陌生,我正在研究 Kafka 是否可以用作实时消息传递代理而不是保留和发送。换句话说,它是否可以只做基本的 pub/sub 代理工作而根本不保留。
是否可以在 Kafka 服务器配置中进行配置?
我不认为这是可能的。 Kafka 和其他消息系统之间的主要区别之一是 Kafka 使用底层 OS 来处理存储。
Another unconventional choice that we made is to avoid explicitly caching messages in memory at the Kafka layer. Instead, we rely on the underlying file system page cache. Whitepaper
所以 Kafka 会自动将消息写入磁盘,因此它默认保留它们。这是 Kafka 的设计者做出的有意识的决定,他们认为这是值得权衡的。
如果您问这个问题是因为您担心写入磁盘可能比将内容保存在内存中慢。
We have found that both the production and the consumption have consistent performance linear to the data size, up to many terabytes of data. Whitepaper
因此,您保留的数据大小不会影响系统的速度。