What You'll Master Here
A triggered run is a relay race — each leg carries the batch to the line, hands off, and stops. A continuous run is a conveyor belt that never stops. Micro-batch runs that same relay every few seconds; it never becomes the belt.
Chapter 2, The Data Pipeline Lifecycle, separated boundedness, a source property, from execution, how you run over it. This chapter is the execution half. Batch and streaming are two execution models, not two speeds. The widget below sorts eight such statements into Triggered or Continuous execution.
Triggered execution plans a job over a finite slice, runs it to completion, commits, and exits. Continuous execution never exits — records flow through one at a time. Micro-batch is triggered execution with the slice made small, tunable from a day down to about a second. That it is "a bit of streaming" is backwards — it is batch, run in a loop, which is why Spark 4.1 needed a new engine, Real-Time Mode.
A triggered run is a relay race — each leg carries the batch to the line, hands off, and stops. A continuous run is a conveyor belt that never stops. Micro-batch runs that same relay every few seconds; it never becomes the belt.
Confusing these for a speed dial causes two costly mistakes: expecting a faster trigger to become streaming, and reaching for a continuous engine when a smaller slice would do.
- triggered execution
- An execution model where the engine plans a job over a finite slice, runs it to completion, commits, and exits.
- streaming
- An execution model of long-lived tasks that process records as they arrive, with no batch boundary — defined by architecture, not speed.
- Commits its offsets, then the tasks exit
- Keeps its state in the task's own memory, with no batch boundary at which the task ever exits
- A nightly job and a 30-second trigger are the same machinery
- Spark Structured Streaming with trigger(processingTime = "30 seconds")
- You can shrink the slice from 24 hours down to about a second
- Below about a second, you are not shrinking a slice — you are changing engines
- Plans a job over a finite slice of input✓ correct home
- Tasks never terminate✓ correct home
Treating micro-batch as "a bit of streaming" instead of batch with a smaller slice. You expect shrinking the trigger to reach streaming and are surprised Spark needed a new engine.
Ask whether a run exits or never exits before calling it batch or streaming.
Treat micro-batch as tunable batch, not cheap streaming.
Default to triggered execution; earn a continuous engine with a stateless, millisecond-critical decision.
Batch and micro-batch share one triggered model, tunable to about a second. Continuous is different — why Spark built a new engine, not a lower number.
Batch and streaming are two execution models, not two speeds; micro-batch is triggered execution with the slice turned down, short of continuous.
- A parking garage recomputes occupancy every 15 minutes. Triggered or continuous execution, and why?
- Name one thing, not a number, that must change to turn a 10-second micro-batch job into a continuous one.
