Skip to content
About
Main content

The governing question and its five answers

What must be remembered, for how long and where, and why is unbounded state always a missing retention rule?

Given input that never ends: what must be remembered, for how long, where does it live, and what happens to it when something moves?

Everything here is one of five answers to that question.

#The answerWhat it coversWhere
1What is remembered and stateful , keyed and , , joins, pattern automataState, Time-shaped state and Joins and enrichment
2How it survives, checkpointing, exactly-onceState and Checkpoints and exactly-once
3How it moves, , rescaling, redistribution, upgradesRescaling and upgrades
4How the flow is regulated through the topology, versus record-at-a-timeBackpressure and batching
5What the output is streams, table-stream , queryable stateChangelogs and queryable state

Answer 1 deserves a longer note, because it unifies a lot. Stateless operators, , windows, joins and pattern matching look like five different features. They are one question wearing five costumes: what is the for the buffer this operator needs?

  • A is a retention rule keyed on time.
  • An is a retention rule keyed on the allowed time difference between the two sides.
  • A pattern automaton is a retention rule keyed on how long a partial match stays possible.

Hold on to that sentence. It explains Ana's Sunday night.

Answer 2: the recovery story is forced. You cannot re-run from the beginning, because the beginning may be years ago. So you must restore the state plus an input position, and that requires the source to be a replayable log. The dependence of streaming on an append-only log is not a style preference. It is the only structure that makes incremental recovery possible.

Answer 3: state is partitioned by key. So changing the means physically moving state. An called key groups exists so that we do not have to move state key by key.

Answer 4: two views of one trade. Backpressure and the batching model are the same trade: how much work do you commit to before you can react?

Answer 5: the duality claim. A table is a materialized changelog, and a changelog is the derivative of a table. This lets streaming output be a first-class input to other jobs. It is also why (messages that take back an earlier result) are unavoidable rather than a design flourish.