Batch vs stream processing
coreintermediateBatch processing runs a job over a bounded, already-collected set of data — yesterday's orders, a full table export — on a schedule or on demand, then finishes. Stream processing runs continuously over an unbounded sequence of events as they arrive, one at a time or in small groups, and never "finishes" in the same sense. The choice is about how fresh the result needs to be versus how much complexity you are willing to run permanently.
Think of it as
Batch is doing a week's laundry every Sunday: you wait until you have a full load, run it once, and it is done until next Sunday. Stream is washing each item the moment it gets dirty: the washing machine runs continuously, output is available almost immediately, but you now have a machine running all week instead of an hour on Sunday, and you have to handle one dirty sock arriving mid-cycle instead of waiting for a full load.
What we're doing: Compare how the same "revenue per customer" report is produced by a batch job and a stream job.
- 2
- Yesterday's partition is bounded by definition -- no new order can ever be added to it, which is what makes the batch job's output reproducible on rerun.
- 12
- State here means the running total the stream job keeps in memory (or a local store) between events -- without it, each event would need to re-read every prior order to compute a new sum.
- 15
- A stream job is redeployed on a code change, not "rerun" the way a batch job is -- it has no natural end to rerun from.
Why this works: The same business question — revenue per customer — produces two different systems depending on whether the answer can wait until tomorrow (batch, bounded, simple) or needs to be current within a second (stream, unbounded, continuously running).
Building a stream pipeline for a report that only needs to be accurate once a day
Wrong
Better
What you see: The team ends up operating a continuously-running stream job — with its own state store, checkpointing, and on-call burden — for a report nobody looks at more than once a day, and every stream-specific failure mode (state growth, checkpoint lag, rebalance stalls) now has to be diagnosed for a freshness requirement the batch job would have met trivially.
Why: Stream processing's cost is standing infrastructure that runs whether or not anyone is watching; that cost buys freshness. When the actual requirement tolerates hours of staleness, a scheduled batch job gets the same answer for a fraction of the operational surface — matching the tool to the actual latency requirement, not the more sophisticated one.
- Batch
- Input is a fixed file or table snapshot
- Job starts, processes everything, exits
- Rerunning the same input reproduces the same result
- Stream
- Input is an unbounded sequence of events
- Job starts once and keeps running indefinitely
- Recovery resumes from a checkpoint, not a full rerun
Batch vs stream processing — the decision-relevant differences
Remember: Batch processes a bounded, already-collected dataset on a schedule and then exits; stream processes an unbounded sequence of events continuously and never exits. Choose based on whether the result needs to be current within seconds (stream) or can wait for the next scheduled run (batch) — not based on which sounds more modern.
See also: latency vs throughput

