Stream processing concept page (/concepts/stream-processing). Source -> operators -> sink pipeline. Stateless operators (filter, map) vs stateful (keyBy, tumbling window aggregate, RocksDB local state). Time semantics: event-time vs processing-time. Watermarks and late events with side output. Backpressure via credit-based flow control. Checkpoint-restore via Chandy-Lamport. Includes 5 scenarios (simple ETL, stateful windowed count, late event handling, backpressure cascade, checkpoint recovery) and 2 ADRs (stream-vs-batch-vs-lambda, event-time-vs-processing-time).
Stream processing — непрерывное вычисление над unbounded input. Correctness определяется тем, что именно упорядочено, какой time domain используется, сколько state удерживается, откуда replay и как output переживает duplicate execution.
| Компонент | Ответственность |
|---|---|
| Event Producers | Создают stable event IDs, keys и event timestamps. |
| Partitioned Replay Log | Даёт per-partition order, retention и replay positions. |
| Keyed Stream Operator | Обрабатывает event-time logic и managed state. |
| Managed State and Checkpoints | Хранит recoverable state; size зависит от workload/serialization. |
| Idempotent Materialized Sink | Применяет event/version identity and exposes lag. |
| Late Event Side Output | Quarantine/reconciliation path beyond lateness policy. |
| Backpressure and Capacity Control | Наблюдает queues, lag, skew и overload policy. |
Events for one business key are routed to one ordered partition/operator key-group. There is no global order across keys unless added with expensive coordination.
Проверяемый исход: Per-key state transitions are deterministic under the stated partitioning and schema contract.
An event arrives after newer event timestamps but before the effective watermark/allowed lateness cutoff. The operator updates the window and emits an update/retraction as the sink contract requires.
Проверяемый исход: Processing order is not confused with event-time order; corrections are explicit.
The operator crashes after a sink call but before progress is durably checkpointed. Replay executes the input again. Stable event/output identity prevents a second logical effect.
Проверяемый исход: At-least-once execution is made safe at the output boundary; it is not renamed universal exactly once.
Sink throughput falls below ingress. Backpressure propagates, lag grows and source retention risk rises. Scaling helps only if the hot key/state/sink can parallelize.
Проверяемый исход: Operations alerts before retention is exhausted and sheds/degrades optional work by policy.
Числа выше — учебные inputs или размерностные формулы. Их нельзя выдавать за benchmark или SLA конкретного продукта.
Диаграмма показывает причинные границы и recovery contracts, а не скрытую реализацию конкретного managed-сервиса. Любая stronger guarantee действует только в явно названной transaction/checkpoint/acknowledgement boundary.
Введите числа или выберите пресет