Kafka Streams:为执行 KTable-KTable 外键连接的应用程序增加主题分区

Kafka Streams: Increasing topic partitions for an application performing a KTable-KTable foreign key join

我找到的大部分信息都与主键连接有关。我知道外键连接是 Kafka Streams 的一个相对较新的功能。我对这将如何扩展很感兴趣。我知道 Kafka Streams 并行性受每个主题的分区数量限制,但是我对增加输入主题分区意味着什么有一些疑问。

Does the foreign key join have the same requirement to co-partition input topics? That is, do both topics need to have the same number of partitions?

没有。有关详细信息,请查看 https://www.confluent.io/blog/data-enrichment-with-kafka-streams-foreign-key-joins/

How does one add a partitions later after the application has been running in production for months or years?

即使您不使用 Kafka Streams,您也无法真正做到这一点。问题是,您的输入数据是按键分区的,如果您添加分区,输入主题中的分区就会中断。 -- 推荐的模式是创建一个具有不同分区数的新主题。

The changelog topics backing each KTable store data from certain input topic partitions. If one is to increase the partitions in the input topics, how does this impact our KTables' state stores and changelogs?

它会破坏应用程序。事实上,如果 Kafka Streams 检测到输入主题分区的数量与更改日志主题分区的数量不匹配,它将进行检查并引发异常。