SimuVedaSystem Design Lab Open in the lab

Data platform / Beginner / 5 min / Updated

Batch vs stream processing: freshness, cost and late events

Hourly batch, micro-batch or a stream processor: see how old the dashboard number is, what the cluster costs, and how a watermark drops late events.

Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.

In short

What is batch vs stream?

Batch jobs process data in scheduled chunks; stream processors update results as each event arrives.

Why does it matter?

Dashboards, fraud checks and alerts need numbers of different freshness, at different costs.

What is the trade-off?

Batch is cheap and handles late data easily but is stale; streams are fresh but always-on and must cut off late events.

How do you explain it in an interview?

"Kafka into Flink for live counts with a 1-minute watermark, plus a nightly Spark batch that rewrites the day with late events."

Check yourself

An hourly batch job feeds a dashboard. On average, how old is the number?

Answer: About half an hour plus the run time. Data arrives all through the hour, so on average it waits half an interval before the next run picks it up.

What does a watermark in stream processing decide?

Answer: How long to wait for late events before closing a time window. Events arriving after the watermark miss their window; a longer watermark keeps more of them but delays results.

Why do many teams run both stream and batch on the same data?

Answer: Stream for a fresh live number, batch later to correct it with every late event. This is the lambda/kappa idea in practice: fast approximate results, then exact ones.

See it happen in the simulation →

batch processingstream processingflinksparkkafka streamswatermarklate eventsdata engineering

More in data platform