Skip to main content
PreparationZone Logo
PrepZone

Stream vs Batch Processing Mental Model

Process VaultCommerce clickstreams as unbounded data — event time, processing time, and watermarks.

Pass checkpoint below

Why this matters

  • VaultCommerce fraud scoring needs sub-second reaction to click patterns, not hourly batch jobs.
  • Event time vs processing time distinction prevents mis-aggregated windows during lag spikes.
  • Watermarks signal 'no more late events expected' — triggers window close.
  • Mental model before Kafka Streams DSL or Flink SQL.
Source topic
groupBy key
Sink topic
Source → map/filter → groupBy → aggregate → sink. State stored in RocksDB with changelog backup.

Bounded vs unbounded

Batch: finite dataset, job completes. Stream: infinite ingress, continuous computation. VaultCommerce clickstream (vaultcommerce.analytics.clicks.v1) never 'finishes' — aggregations run forever with rolling windows.

Key points

  • Unbounded stream — continuously arriving records without defined end
  • Event time — timestamp when business event occurred
  • Processing time — when stream processor observes the record
  • Watermark — heuristic for event-time progress; advances window closure
  • Late arrival — record after watermark; dropped or side-output

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 2 sections

  • Time semantics
  • VaultCommerce rollout checklist

Test yourself

Answer these before moving on — recall is what makes it stick.