Intermediatecomparison
Batch or streaming: how do you decide?
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
Key points
- latency need
- cost and complexity
- reprocessing
- hybrid
References
- Google SRE book: data processing pipelines
- Jay Kreps (O'Reilly): Questioning the Lambda Architecture
- Apache Airflow: best practices (idempotent tasks)
- Kafka message delivery semantics
- Spark Structured Streaming: watermarks, deduplication, sinks
- Spark Structured Streaming + Kafka integration
- Confluent Schema Registry: schema evolution and compatibility
- Databricks: medallion architecture