CCDAK · Question #130
Select the Kafka Streams joins that are always windowed joins.
The correct answer is A. KStream-KStream join. KStream-KStream joins must always be windowed because both sides are unbounded event streams with no inherent "current state" - without a time window, the join would need to buffer every record forever to find potential matches, which is impractical. A window (tumbling…
Question
Select the Kafka Streams joins that are always windowed joins.
Options
- AKStream-KStream join
- BKTable-KTable join
- CKStream-GlobalKTable
- DKStream-KTable join
How the community answered
(25 responses)- A96% (24)
- D4% (1)
Explanation
KStream-KStream joins must always be windowed because both sides are unbounded event streams with no inherent "current state" - without a time window, the join would need to buffer every record forever to find potential matches, which is impractical. A window (tumbling, hopping, or sliding) defines the time boundary within which records from each stream are eligible to join.
KTable-KTable joins (B) are not windowed - each KTable represents the latest materialized state per key, so a join simply combines the current values from both tables whenever either side is updated. KStream-GlobalKTable joins (C) are also not windowed - the GlobalKTable is a fully-replicated lookup table available on every partition, so each stream record is simply looked up against the current state of the table at arrival time. KStream-KTable joins (D) work the same way: the stream record arrives and is matched against the current KTable value, no window required.
Memory tip: If both sides are streams (unbounded), you need a window to bound the join - think "stream + stream = fence it with time." Any join involving at least one Table uses the table's current state as the anchor, eliminating the need for windowing.
Topics
Community Discussion
No community discussion yet for this question.