NEW
Aggregating small time-sliced batches of events to approximate real-time processing with simplified execution semantics.
DESCRIPTION
Micro-batching groups incoming events into small, discrete batches processed at short intervals, striking a balance between latency and throughput. Frameworks like Spark Structured Streaming implement micro-batch triggers to schedule computation. This approach leverages batch execution engines while delivering near-real-time results. It simplifies fault tolerance and state management compared to pure record-at-a-time streaming. Trade-offs include added latency relative to continuous processing and trigger tuning complexity.
ALTERNATIVE DEFINITIONS
Apache Spark
In micro-batch mode, the engine processes data streams in small batches at a user-specified trigger interval.
Clarifies scheduling and user control over batch trigger intervals.
Databricks
In the micro-batch processing mode, Spark Structured Streaming processes data streams as a series of small batch jobs.
Emphasizes batch job execution for streaming workloads.
RELATED TERMS
Streaming Spark Structured Streaming Trigger Interval Delays Exactly-Once Processing Backpressure Checkpointing Windowing Event Time
COMPETING TERMS
Continuous Processing Batch Processing
KNOWLEDGE AREAS
Real-time & Streaming Data Data Engineering Data Architecture Platform & Tooling
TARGET AUDIENCE
Data Engineer MLOps Engineer AI Engineer Software Developer Solution Architect
EXTERNAL SOURCES
- Wikipedia - Stream processing
- Apache Spark - Trigger configuration for micro-batches
- Apache Flink - Mini-batch concept in Flink table API
TOP QUESTIONS
When should I use Micro-batching?
Use it when you need near-real-time results but prefer batch engine reliability and simpler fault tolerance.
Category: Example
How do I choose the trigger interval for Micro-batching?
Balance latency and throughput; start with seconds, measure end-to-end SLAs, and tune based on backpressure and costs.
Category: Requirements
What are common mistakes with Micro-batching?
Setting overly aggressive triggers, ignoring checkpointing, and not accounting for late data can cause instability and inaccuracies.
Category: Mistakes
What risks come with Micro-batching?
Too-small batches increase overhead and costs; too-large batches raise latency and state spikes during catch-up.
Category: Risks
How does Micro-batching compare to continuous processing?
Micro-batching adds small latency but simplifies execution; continuous mode minimizes latency with more complex runtime semantics.
Category: Alternatives
Does Micro-batching support exactly-once semantics?
Yes, with checkpointing and idempotent sinks, most frameworks can achieve effectively exactly-once outcomes.
Category: Requirements
Is Micro-batching suitable for ML feature pipelines?
Yes, it provides predictable cadence for feature computation and materialization with manageable latency.
Category: Example
How does Micro-batching affect costs?
Frequent triggers may increase compute overhead; right-sizing batch intervals and autoscaling helps control spend.
Category: Opinion
What is a hot topic around Micro-batching?
Unifying micro-batch and streaming semantics in declarative APIs is an active area.
Category: Topic