Recall & Review
beginner
What is a KStream in Kafka Streams?
A KStream is a continuous flow of records where each record represents a single event or update. It models data as an unbounded, real-time stream of events.
Click to reveal answer
beginner
What is a KTable in Kafka Streams?
A KTable is a changelog stream that represents a table of key-value pairs. It models data as a snapshot of the latest state for each key, updating over time.
Click to reveal answer
intermediate
How does a KStream differ from a KTable?
A KStream represents each event as a separate record (event-driven), while a KTable represents the latest value for each key (state-driven). KStream is like a log of changes; KTable is like a database table with current state.
Click to reveal answer
beginner
What happens when you update a key in a KTable?
The KTable updates the value for that key, replacing the old value with the new one. This means the table always holds the latest state for each key.
Click to reveal answer
intermediate
Can you perform joins between KStreams and KTables?
Yes, Kafka Streams supports joins between KStreams and KTables. For example, joining a KStream with a KTable enriches the stream events with the latest state from the table.
Click to reveal answer
Which Kafka Streams abstraction represents a continuous stream of events?
✗ Incorrect
KStream models a continuous flow of event records in Kafka Streams.
What does a KTable represent?
✗ Incorrect
KTable represents the latest value for each key, like a table of current state.
If you want to keep track of the latest user profile info, which abstraction should you use?
✗ Incorrect
KTable holds the latest state per key, ideal for user profiles.
What happens when a key is updated in a KTable?
✗ Incorrect
KTable updates the value for the key to keep the latest state.
Which join enriches a stream of events with the latest state from a table?
✗ Incorrect
Joining a KStream with a KTable adds the latest table state to each stream event.
Explain in your own words the difference between a KStream and a KTable.
Think about a log of events versus a database table.
You got /4 concepts.
Describe a real-life example where you would use a KTable instead of a KStream.
Consider situations where you want to know the current status, not every change.
You got /4 concepts.