Batch vs Micro-Batch vs True Stream Processing
Choose batch, micro-batch, or continuous streaming based on latency SLOs and complexity budget.
In plain words
Source event to consumer decision p95. Next, replay, lateness, and joins. Finally, backlog drain and checkpoint restart at peak rate.
Think of it like…
Batch is a scheduled delivery truck, micro-batch is a shuttle leaving every 30 seconds, and true streaming is an always-moving conveyor that handles each parcel as it arrives.
Where you’ve seen it
Invoices settle in hourly batch, fraud indicators refresh every 30 seconds by micro-batch, and market or ad-event joins use Flink continuous windows only because subsecond reactions are required.
Words you’ll hear
- Batch
- Finite jobs over explicit input intervals with clear completeness and full/ incremental partition semantics.
- Micro-Batch
- Repeated small bounded batches whose trigger and completion cadence set the practical latency floor.
- Streaming
- Long-running continuous processing where operators advance state per event and commit checkpoints.
- Operational boundary
- A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink. Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO.
Visual diagram
Theory & deep dive
Batch: the working mechanism
Batch processes a finite bounded dataset, micro-batch divides a stream into small interval batches, and true stream processing advances per-event state continuously with explicit source progress and fault tolerance.
Source event to consumer decision p95. Replay, lateness, and joins, then finite batch, trigger batches, or continuous operators; this exposes the state governed by Streaming.
Invoices settle in hourly batch, fraud indicators refresh every 30 seconds by micro-batch, and market or ad-event joins use Flink continuous windows only because subsecond reactions are required.
Batch vs Micro-Batch vs True Stream Processing: failure mode and production response
A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO. Track Latency SLO as "p95 event-to-decision plus tolerated backlog", and make Throughput headroom visible to the dataset owner.
How it works, step by step
Step 1 of 41. Define latency
Source event to consumer decision p95. Batch processes a finite bounded dataset, micro-batch divides a stream into small interval batches, and true stream processing advances per-event state continuously with explicit source progress and fault tolerance.
- Latency SLO
- p95 event-to-decision plus tolerated backlog
- Micro-Batch
- Repeated small bounded batches whose trigger and completion cadence set the practical latency floor.
When to use it & trade-offs
What it is
Batch processes a finite bounded dataset, micro-batch divides a stream into small interval batches, and true stream processing advances per-event state continuously with explicit source progress and fault tolerance. Invoices settle in hourly batch, fraud indicators refresh every 30 seconds by micro-batch, and market or ad-event joins use Flink continuous windows only because subsecond reactions are required.
Why it matters: A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink. Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO.
When to reach for it
- Choose batch, micro-batch, or continuous streaming based on latency SLOs and complexity budget.
- Choose Batch because it provides this capability: Finite jobs over explicit input intervals with clear completeness and full/ incremental partition semantics.
- Keep evidence for Latency SLO at "p95 event-to-decision plus tolerated backlog" so the last production stage-Prove recovery - backlog drain and checkpoint restart at peak rate-remains testable.
When to avoid or be careful
- A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
- Do not conflate Micro-Batch with Batch. The second concept contributes different behavior: Repeated small bounded batches whose trigger and completion cadence set the practical latency floor.
- Release only after this guardrail is in place: Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO.
Batch / Micro-Batch / Streaming - roles, limits, and operating cost
Strengths: Finite jobs over explicit input intervals with clear completeness and full/ incremental partition semantics. Batch processes a finite bounded dataset, micro-batch divides a stream into small interval batches, and true stream processing advances per-event state continuously with explicit source progress and fault tolerance.
Watch out: A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
Strengths: Repeated small bounded batches whose trigger and completion cadence set the practical latency floor. In this workflow it supports: Choose runtime - finite batch, trigger batches, or continuous operators.
Watch out: The operating cost is real: sustained capacity above observed peak.
Strengths: Long-running continuous processing where operators advance state per event and commit checkpoints. Its output can be checked with Recovery time.
Watch out: Operating guardrail: Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO.
Interview signals & numbers to know
When this topic comes up
- “Where is the failure boundary for Batch, and how would Latency SLO reveal it?”
- “Why is Micro-Batch distinct from this behavior: long-running continuous processing where operators advance state per event and commit checkpoints?”
- Production clue: A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
- Design probe: Start from decision latency, event-rate peaks, ordering/lateness, replay, state, and operator budget; choose the simplest finite/bounded mechanism that meets p95 end-to-end delay and a testable recovery SLO.
Benchmarks & rules of thumb
- Latency SLO
- p95 event-to-decision plus tolerated backlog
- Throughput headroom
- sustained capacity above observed peak
- Recovery time
- checkpoint restore plus backlog catch-up
Common mistakes & follow-ups
Common interview mistakes
- A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
- Reporting success from a job exit code without checking Latency SLO and Throughput headroom.
- Treating this example as complete without replay, rollback, or access boundaries: Invoices settle in hourly batch, fraud indicators refresh every 30 seconds by micro-batch, and market or ad-event joins use Flink continuous windows only because subsecond reactions are required.
Likely interviewer follow-ups
- How would you prove this contract instead of only checking that the command ran: Finite jobs over explicit input intervals with clear completeness and full/ incremental partition semantics.
- What does the recovery plan do when this occurs? A product team may request 'real time' for a daily executive metric, while a micro-batch pipeline promises second-level latency that cannot be met because its batch runs longer than the trigger or downstream sink.
- When is Batch insufficient for Throughput headroom, and what does adding Micro-Batch cost in Latency SLO?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply Batch vs Micro-Batch vs True Stream Processing with data engineer interview Q&A and hands-on practice.