Skip to main content

Micro-batch vs. continuous streaming: which is better for low-latency operational workloads?

Summary

  • Micro-batch processing accumulates records over a configurable interval and processes them as a batch, delivering sub-second to second-level latency with exactly-once fault tolerance.
  • Continuous streaming processes records as they arrive (near-one-at-a-time), achieving lower per-record latency but with more operational complexity and harder consistency guarantees.
  • For most low-latency operational workloads, micro-batch with a short trigger interval is the right choice: it combines throughput efficiency, exactly-once semantics, and predictable recovery.
  • Databricks Spark Structured Streaming defaults to micro-batch execution; Real-Time Mode extends this to sub-second end-to-end latency for the most demanding use cases.
  • Continuous processing as a standalone model is an option in specialized frameworks like Apache Flink, but comes with tradeoffs in fault tolerance and operational complexity.

Micro-batch vs. continuous streaming: which is better for low-latency operational workloads?
For most low-latency operational workloads, micro-batch processing with a short trigger interval is the right answer. It delivers sub-second latency, exactly-once semantics, and high throughput, with a familiar execution model that is much easier to operate and debug than record-at-a-time continuous systems. Continuous streaming offers lower per-record latency for very specialized use cases, but at a cost in fault-tolerance guarantees and operational complexity. On Databricks, Spark Structured Streaming's Real-Time Mode closes the latency gap further, handling the needs of most demanding real-time pipelines without switching to a continuous model.

What are micro-batch and continuous streaming?

Micro-batch processing divides a stream into small batches of records, processes each batch as a unit, and commits the results on a configurable interval. The batch size and commit frequency determine end-to-end latency. Apache Spark Structured Streaming uses this model by default, providing exactly-once processing guarantees via checkpoint-based recovery.
Continuous streaming (or record-at-a-time processing) handles records as they arrive without waiting to accumulate a batch. This minimizes the time from event ingestion to processing output. Frameworks like Apache Flink are designed around this model. The tradeoff: achieving exactly-once semantics in a continuous model requires more complex checkpoint coordination, and systems can be harder to tune and debug under production load.

Micro-batch vs. continuous streaming: how they compare

Aspect Micro-batch Continuous Streaming
Processing model Accumulates records over a configurable interval, then processes as a batch Processes records as they arrive, near-one-at-a-time
Latency profile Sub-second to seconds, depending on trigger interval Lower per-record latency; total pipeline latency depends on throughput and configuration
Fault tolerance Exactly-once via checkpoint-based recovery (Spark, Lakeflow Pipelines) Exactly-once is harder to guarantee; async checkpoints complicate recovery
Throughput High (batch amortizes per-record overhead) Lower effective throughput per resource due to per-record overhead
Operational complexity Familiar batch-style execution model; straightforward debugging More tuning required; harder to isolate failures under load
Backpressure handling Natural via batch interval (prevents resource exhaustion) Requires explicit configuration and monitoring
Best suited for Fraud detection, ETL, real-time analytics, operational dashboards Workloads where per-record latency is the primary constraint

How Databricks handles low-latency streaming

Spark Structured Streaming on Databricks uses micro-batch execution as the default, with four trigger options to balance latency and cost:

  • Unspecified (default): runs continuously, processing available data every few seconds.
  • Processing Time: set a fixed interval (for example, every 10 seconds) to balance cost and freshness for less time-sensitive pipelines.
  • Available Now: processes all available records as a single incremental batch, suited for scheduled jobs.
  • Real-Time Mode: a modified execution model that reduces end-to-end latency to sub-second, designed for fraud detection, live dashboards, and other low-latency operational workloads.

Continuous mode (an experimental Apache Spark feature) is not supported on Databricks. Real-Time Mode serves this use case instead, delivering sub-second end-to-end latency with better fault-tolerance guarantees than continuous mode provides.
For pipeline authoring, Lakeflow Pipelines provides a declarative framework built on Spark Structured Streaming. It handles dependency management, incremental processing, data quality checks, and backfills automatically, so teams focus on business logic rather than pipeline plumbing. Lakeflow Pipelines supports batch and streaming workloads in the same pipeline definition, under Unity Catalog governance.

FAQs

What is Real-Time Mode in Spark Structured Streaming?

Real-Time Mode is a Databricks-specific trigger setting that delivers sub-second end-to-end latency for streaming pipelines. It uses a modified micro-batch approach optimized for low-latency operational workloads such as fraud detection and real-time analytics dashboards, without requiring the complexity of a continuous streaming model.

When does continuous streaming make sense?

Continuous streaming is appropriate when your workload demands the absolute lowest per-record latency and you're using a framework designed for it, such as Apache Flink. It's a niche choice: the consistency and operational tradeoffs mean micro-batch with a short interval covers the vast majority of real-world low-latency needs.

Does Lakeflow Pipelines support both batch and streaming?

Yes. A single Lakeflow Pipelines definition can include batch data sources, streaming sources, or both. The framework handles execution, dependency resolution, and incremental updates regardless of source type, under Unity Catalog governance.

How does trigger interval affect latency and cost?

Shorter trigger intervals reduce latency but increase the number of metadata and storage API calls per unit time, which can raise operational costs on cloud storage. For workloads with a latency target of a few seconds, a Processing Time trigger with a moderate interval balances freshness and cost. For sub-second requirements, Real-Time Mode is purpose-built for that profile.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.