A KStream is an abstraction of a record stream– Each record represents a self-contained piece of data in the unbounded dataset▪ A KTable is an abstraction of a changelog stream– Each record represents an update▪ Example: We send two records to the stream– ('apple', 1), and ('apple', 5)▪ If we were to treat the stream as a KStream and sum up the values forapple, theresult would be 6▪ If we were to treat the stream as a KTable and sum up the values for apple,theresult would be 5– The second record is treated as an update to the first, because they have thesamekey▪ Typically, if you are going to treat a topic as a KTable it makes sense toconfigurelog compaction on the topicCopyright © 2015, 2016, 2017