Skip to main content
Intermediatecomparison

Batch or streaming: how do you decide?

Source: Google SRE book: data processing pipelines

Quick answer

From the consumer's latency need, not from fashion. If the business acts on the data daily or hourly, batch is simpler, cheaper, easier to reprocess and easier to test.

From the consumer's latency need, not from fashion. If the business acts on the data daily or hourly, batch is simpler, cheaper, easier to reprocess and easier to test. Streaming is worth its cost when decisions need seconds or minutes: alerts, fraud, live operations. Streaming brings state, watermarks, checkpoints, ordering and always-on compute. A common answer is both: stream into bronze for freshness, and batch-build the curated, reconciled tables.

Animated explanation

Batch

  • Hours of latency are fine
  • Simple retries and backfills
  • Compute only while running

Streaming

  • Seconds to minutes
  • State, watermarks, checkpoints
  • Always-on compute
Start from how fast someone acts on the data; choose the simplest system that meets it.

Key points

  • latency need
  • cost and complexity
  • reprocessing
  • hybrid

References

Discussion