liveBook · Manning

Table-to-table join

As explained in Apache Kafka in Action

A table-table join combines two changing tables and updates results when either table changes.

A table-to-table join combines two changing tables and continuously updates the result when either table changes. Each side represents the latest state for a key, so a change on one side can look up the matching value on the other. section 12.4.3

Use a table-to-table join reliably by checking these conditions:

  • Co-partition both inputs: use the same number of partitions and the same join key. Otherwise, change one topic's key before joining. section 12.4.3
  • Choose the join semantics deliberately. An inner join suits relationships where an unmatched record has no useful meaning. section 12.4.3
  • Expect updates from both inputs, unlike a stream-table join, which is triggered by new stream data. section 12.7

Attach customers to loyalty cards

Read loyalty_cards and customers as tables, join them by primary key, and use a ValueJoiner to attach the customer to each loyalty card. A customer update can therefore revise the joined result even when the loyalty-card table does not change. section 12.4.3

How Apache Kafka in Action covers it

How deep it goes
Explains key alignment, partitioning, triggering behavior, and inner-join selection, then demonstrates the Kafka Streams structure.
Examples
Uses loyalty cards joined with customers and contrasts them with price changes correlated with sales inside a one-minute window.
What it assumes
Assumes familiarity with Kafka topics, keys, partitions, tables, and streams while teaching co-partitioning as a join requirement.
What you can do after
Build it with Kafka Streams by defining keyed tables, selecting a joiner, and applying a primary-key join.
How it connects
Connects primary-key joins with co-partitioning, stream-table joins, stream-stream joins, and time windows.

Also explained in

Compare how 2 books explain table-to-table join →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.