Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 121/ 160
07. Streaming & Real-Time Data Engineering

Batch vs Micro-Batch vs True Stream Processing

Choose batch, micro-batch, or continuous streaming based on latency SLOs and complexity budget.

BeginnerBatch · Micro-Batch · Streaming3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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

Loading interactive 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.

Batch vs Micro-Batch vs True Stream Processing in one concrete design

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.

Key takeaway: 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

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.

Key takeaway: 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.

How it works, step by step

Step 1 of 4
Batch

1. 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.

source event to consumer decision p95
Key numbers at this step
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

Batch
Best for: Finite jobs over explicit input intervals with clear completeness and full/ incremental partition semantics.

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.

Micro-Batch
Best for: Repeated small bounded batches whose trigger and completion cadence set the practical latency floor.

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.

Streaming
Best for: Long-running continuous processing where operators advance state per event and commit checkpoints.

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?
Interview tip: Lead with the data path and failure boundary: 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. Then make the answer operational: 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.

Knowledge check

Loading quiz

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.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Designing Idempotent, Self-Healing & Backfillable Pipelines
Next topic
Event-Driven Architecture & Message Brokers Overview