fold
Combining a sequence of records one by one into a single result, such as the latest value or a running total per key.
In more detail
Folding a topic from offset zero always gives the same result, which is how a consumer builds a table or view from a stream. Summing a list and building a lookup table of latest values are both folds.
Related terms
- stream-table duality — The idea that a stream of changes and a table of current values are two views of the same data: fold the stream to get the table, and record the table's changes to get the stream.
- materialised view — A stored table of results computed from other data, kept so queries do not have to recompute them.
- state store — Local storage where a stream processing application keeps the current results of its computations.
Taught in
- Log Compaction: A Topic As A Table — Apache Kafka & Event Streaming
- Materialised Views From A Stream — Apache Kafka & Event Streaming