Handbooks  /  Streaming vs Batch
Engineering~8 min readComparison
Head to Head

Streaming vs batch: is being fast worth the cost?

StreamingvsBatch

Streaming's real engineering tax isn't "processing faster" — it's handling data that arrives late, out of order, or twice, in real time, instead of getting to assume it's already clean by the time you touch it.

01

The one distinction that decides everything

Batch processing collects data over a window and processes all of it at once, on a schedule — hourly, nightly. Streaming processes each event as it arrives, continuously, with results available near-instantly. The distinction isn't about data volume — it's about whether the VALUE of an insight decays before the next scheduled batch run would deliver it.

→ The rule

If a result being hours stale is fine, batch is simpler and cheaper. If the value of the insight decays within seconds — fraud, alerting, live UX — you need streaming.

02

Head to head

DimensionStreamingBatch
LatencySub-second to secondsMinutes to hours/days — as fresh as the last run
ComplexityHigher — disorder, windowing, exactly-once semanticsLower — deterministic, easy to reprocess/backfill
Cost modelNeeds always-on infrastructureCan use cheap scheduled/spot compute
Failure recoveryCheckpointing / replay from an offsetRerun the job — naturally idempotent
Use case shapeFraud detection, live dashboards, alertingEnd-of-day reports, ETL, large aggregate analytics
ToolingKafka Streams, Flink, Spark Structured StreamingSpark, Airflow, dbt
03

When to use each

Reach for batch

  • Freshness of hours or days is genuinely fine
  • Want simplicity and easy reprocessing/backfills
  • Cost-sensitive — spot/scheduled compute is enough
  • Complex joins/aggregations over huge historical windows

Reach for streaming

  • Need sub-second to seconds decisions
  • The insight’s value decays fast with delay
  • Live UX — dashboards, alerts, personalization
  • Fraud or anomaly detection at the moment it happens
04

Lambda and Kappa: running both

Many real systems run both paths deliberately: a fast streaming path gives approximate, real-time results immediately, while a slower batch path recomputes exact, corrected results later and reconciles the two (this is the Lambda architecture). Increasingly, teams instead push everything through the streaming engine and treat "batch" as simply a stream replayed over a bounded window (the Kappa architecture), to avoid maintaining two separate codepaths for the same logic.

→ The modern default

Kappa (one streaming codepath, batch = replay a window) is gaining ground over Lambda's two-codepath approach specifically because maintaining the same logic twice, in two different processing models, is its own ongoing cost.

05

The real cost isn’t speed — it’s correctness under disorder

It's intuitive to think streaming is just "batch, but faster" — but the actual engineering tax streaming adds comes from a different place: events in the real world arrive out of order, late, or duplicated, because they cross an unreliable network from many independent sources. A completed batch window sidesteps this almost entirely — by the time you process it, the data for that window is already complete and effectively ordered, because you waited for the window to close before touching it.

Streaming has no such luxury: it has to make a decision on data as it arrives, without knowing whether more (older) data is still in flight. This forces explicit concepts batch gets for free — EVENT TIME vs PROCESSING TIME (when something actually happened vs when your system saw it), WATERMARKS (a heuristic for "how late are we willing to wait before assuming no more data is coming for this window"), and delivery semantics (exactly-once vs at-least-once, since a network retry can duplicate an event). None of this is about raw processing speed; it's the cost of making correct decisions on data whose completeness you can't yet verify.

→ The trade you’re actually making

Batch gets ordering and completeness for free by waiting. Streaming gives up that wait — and has to explicitly engineer around the disorder waiting would have quietly resolved.

06

A worked scenario: churn scoring vs live fraud detection

An e-commerce platform computes "customers likely to churn" scores in a nightly batch job over the full order history — being a day stale is completely fine here, and the job benefits from large historical joins that are much simpler to reason about once the day's data is known to be complete and ordered.

The same platform needs streaming for fraud detection on live checkout attempts, where a decision has to be made in the roughly 200ms before a payment authorizes — batch's next scheduled run, even an hour away, would be far too late to stop a fraudulent charge that's happening right now. Notice these aren't different scales of the same problem; they're genuinely different problems, one where waiting costs nothing and one where waiting is the failure.

→ The pattern generalizes

Ask: what happens if this result arrives an hour late instead of instantly? If the answer is "nothing bad," batch is simpler and cheaper. If the answer is "the decision is now useless," you need streaming.

Frequently asked

Quick answers

Streaming or batch — which should I use?

Ask how fast the value of the result decays. If hours or days of staleness is fine, batch is simpler and cheaper. If the insight needs to act within seconds — fraud, alerting, live UX — you need streaming.

Is streaming just faster batch processing?

No — the core added cost isn’t speed, it’s correctness under disorder. Streaming has to handle events arriving late, out of order, or duplicated in real time, using concepts like event-time, watermarks, and delivery semantics that batch gets for free by simply waiting for a window to close.

What is the Lambda architecture?

Running both a fast streaming path (approximate, real-time results) and a slower batch path (exact, corrected results) in parallel, then reconciling them — used when you need both immediate approximate answers and eventually-correct exact ones.

What is the Kappa architecture?

A simplification of Lambda that pushes everything through a single streaming codepath, treating batch processing as simply replaying a stream over a bounded historical window — avoiding the cost of maintaining the same logic twice in two different systems.

Streaming vs Batch · Vibe Engines · 2026
Finished this one? 0 / 115 Handbooks done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.