An online store wants to track accepted orders per minute and match orders with captured payments. Both requirements involve several records, but they ask different questions. Counting combines events into a result. Payment matching connects events that belong together.
Time adds another decision. An order may arrive late, and a payment may reach Kafka before the order event it belongs to. The application needs precise rules for which records contribute and how long it will wait for missing information.
This chapter explains aggregations, time windows, and the main Kafka Streams join types. We'll use order reporting examples to show how keys, timestamps, and update semantics determine the results.