DataEng study
Offline — showing the cached copy.
Home / Data Engineering System Desi / 2. Batch, micro-batch, streaming

2. Batch, micro-batch, streaming

One-liner. Choose latency first; everything else follows from it.

Memorize

  • Batch: cheapest per row, high throughput, stale by design. Good for finance, reporting, backfills.
  • Micro-batch: small intervals, still batch semantics (Spark Structured Streaming triggers).
  • Streaming: event-at-a-time, state + watermarks, ordering per key, exactly-once only within the engine.
  • Lambda architecture (batch + speed layers) vs Kappa (one streaming path, replay from log).
  • Late data needs a watermark and a lateness policy (drop, retry, side output).
  • Streaming is operationally harder: state stores, checkpoints, backpressure.
KAPPA PIPELINE Producers Kafka Stream processor Serving store Data lake Consumers
Kappa pipeline

Trap. "Real-time dashboard" built on a 15-minute batch job — the requirement was latency, not technology. Do this. Convert "real-time" into a number (seconds? minutes?) before choosing.

Check

Finance needs a report at 06:00 daily over 2 TB. Marketing wants 30-second campaign metrics. What is the correct split?