<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Stream_processing</id>
	<title>Stream processing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Stream_processing"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Stream_processing&amp;action=history"/>
	<updated>2026-12-06T00:07:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=Stream_processing&amp;diff=78&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@9783fe6</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Stream_processing&amp;diff=78&amp;oldid=prev"/>
		<updated>2026-11-22T21:29:57Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@9783fe6&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = Stream processing&lt;br /&gt;
| also_known_as   = Streaming, unbounded data processing&lt;br /&gt;
| field           = Data engineering, distributed systems&lt;br /&gt;
| key_parts       = Unbounded input, event time, windows, state, [[Watermark]]s, triggers, checkpoints&lt;br /&gt;
| implementations = [[Structured Streaming]] ([[Apache Spark]]), [[Apache Flink]], Kafka Streams ([[Apache Kafka]])&lt;br /&gt;
| related         = [[Watermark]], [[Exactly-once semantics]], [[Streaming lakehouse]], [[Spark Streaming (DStreams)]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-22|the Spark 4.3.0 Structured Streaming guides, the Apache Flink 2.3 documentation, the Apache Kafka 4.4 Streams documentation and the Dataflow Model paper (VLDB 2015)}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Stream processing&amp;#039;&amp;#039;&amp;#039; is the continuous computation of results over data that has no defined end, in which an engine processes records as they arrive and keeps its output up to date instead of waiting for a complete dataset. The input is called an &amp;#039;&amp;#039;&amp;#039;unbounded&amp;#039;&amp;#039;&amp;#039; dataset or stream; data with a fixed start and end is &amp;#039;&amp;#039;&amp;#039;bounded&amp;#039;&amp;#039;&amp;#039;.&amp;lt;ref name=&amp;quot;flink-arch&amp;quot;&amp;gt;{{Cite web |url=https://flink.apache.org/what-is-flink/flink-architecture/ |title=What is Apache Flink? Architecture |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; In the open lakehouse, the term covers engines such as [[Structured Streaming]], [[Apache Flink]] and Kafka Streams, which read from message buses and write to tables, topics or other systems.&lt;br /&gt;
&lt;br /&gt;
== Unbounded data, not a kind of engine ==&lt;br /&gt;
The Dataflow Model paper (Akidau et al., Google, published in the Proceedings of the VLDB Endowment in 2015) prefers the terms &amp;quot;unbounded&amp;quot; and &amp;quot;bounded&amp;quot; to &amp;quot;streaming&amp;quot; and &amp;quot;batch&amp;quot;, because the latter imply a particular execution engine. The paper notes that unbounded data has long been processed by repeated batch runs, and that well-designed streaming systems can also process bounded data; it reserves &amp;quot;streaming&amp;quot; and &amp;quot;batch&amp;quot; for describing runtime engines.&amp;lt;ref name=&amp;quot;dataflow&amp;quot;&amp;gt;{{Cite web |url=https://www.vldb.org/pvldb/vol8/p1792-Akidau.pdf |title=The Dataflow Model: A Practical Approach to Balancing Correctness, Latency, and Cost in Massive-Scale, Unbounded, Out-of-Order Data Processing |author=Tyler Akidau, Robert Bradshaw, Craig Chambers, Slava Chernyak, Rafael J. Fernández-Moctezuma, Reuven Lax, Sam McVeety, Daniel Mills, Frances Perry, Eric Schmidt, Sam Whittle |publisher=Proceedings of the VLDB Endowment, Vol. 8, No. 12 |date=2015 |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Apache Flink documentation draws the same line: batch processing is processing of a bounded stream, where the engine may read the whole input before producing results (for example, to sort it), while an unbounded stream must be processed continuously as data arrives.&amp;lt;ref name=&amp;quot;flink-learn&amp;quot;&amp;gt;{{Cite web |url=https://nightlies.apache.org/flink/flink-docs-stable/docs/learn-flink/overview/ |title=Learn Flink: Hands-On Training |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Core ideas ==&lt;br /&gt;
=== Event time and processing time ===&lt;br /&gt;
Every record has at least two times. &amp;#039;&amp;#039;&amp;#039;Event time&amp;#039;&amp;#039;&amp;#039; is when the event occurred on the device or system that produced it. &amp;#039;&amp;#039;&amp;#039;Processing time&amp;#039;&amp;#039;&amp;#039; is the clock time of the machine that handles the record.&amp;lt;ref name=&amp;quot;flink-time&amp;quot;&amp;gt;{{Cite web |url=https://nightlies.apache.org/flink/flink-docs-stable/docs/concepts/time/ |title=Timely Stream Processing |publisher=Apache Software Foundation (Apache Flink 2.3 documentation) |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Kafka Streams adds a third, &amp;#039;&amp;#039;&amp;#039;ingestion time&amp;#039;&amp;#039;&amp;#039;: when a Kafka broker stored the record in a topic partition.&amp;lt;ref name=&amp;quot;kstreams&amp;quot;&amp;gt;{{Cite web |url=https://kafka.apache.org/44/streams/core-concepts/ |title=Kafka Streams Core Concepts |publisher=Apache Software Foundation (Apache Kafka 4.4 documentation) |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Dataflow paper points out that event time for an event never changes, while the skew between event time and processing time varies constantly because of network delays, scheduling and processing time.&amp;lt;ref name=&amp;quot;dataflow&amp;quot; /&amp;gt; Records therefore arrive out of order, and a result grouped by event time is never certain to be complete. A [[watermark]] is the engine&amp;#039;s estimate of how far event time has progressed, and it lets the engine decide when a result is final.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
Aggregations over an unbounded stream need finite groups, called &amp;#039;&amp;#039;&amp;#039;windows&amp;#039;&amp;#039;&amp;#039;. Three types are common across engines:&amp;lt;ref name=&amp;quot;dataflow&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;ss-apis&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/streaming/apis-on-dataframes-and-datasets.html |title=Structured Streaming: APIs on DataFrames and Datasets (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;flink-time&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Window !! Definition !! Example&lt;br /&gt;
|-&lt;br /&gt;
| Tumbling (fixed) || Fixed size, non-overlapping, contiguous intervals; each record belongs to one window || Counts per 5-minute interval&lt;br /&gt;
|-&lt;br /&gt;
| Sliding || Fixed size with a slide shorter than the size, so windows overlap and a record can belong to several || 10-minute windows starting every 5 minutes&lt;br /&gt;
|-&lt;br /&gt;
| Session || Variable size; a window grows while records keep arriving within a gap duration, and closes after a gap with no input || One window per user visit, closed after 30 idle minutes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In PySpark the three types map to two functions: &amp;lt;code&amp;gt;window()&amp;lt;/code&amp;gt; for tumbling and sliding windows and &amp;lt;code&amp;gt;session_window()&amp;lt;/code&amp;gt; for session windows.&amp;lt;ref name=&amp;quot;ss-apis&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pyspark.sql.functions import window, session_window&lt;br /&gt;
&lt;br /&gt;
events.groupBy(window(&amp;quot;ts&amp;quot;, &amp;quot;5 minutes&amp;quot;))                 # tumbling&lt;br /&gt;
events.groupBy(window(&amp;quot;ts&amp;quot;, &amp;quot;10 minutes&amp;quot;, &amp;quot;5 minutes&amp;quot;))   # sliding&lt;br /&gt;
events.groupBy(&amp;quot;user&amp;quot;, session_window(&amp;quot;ts&amp;quot;, &amp;quot;30 minutes&amp;quot;)) # session&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== State ===&lt;br /&gt;
Aggregations, joins and deduplication must remember earlier records, so the engine keeps &amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039; between inputs. Structured Streaming keeps it in a state store, with an optional RocksDB-based provider.&amp;lt;ref name=&amp;quot;ss-apis&amp;quot; /&amp;gt; Flink keeps task state in memory and moves large state to on-disk structures.&amp;lt;ref name=&amp;quot;flink-arch&amp;quot; /&amp;gt; State grows without bound unless something says when old entries can be dropped; in event-time queries that signal is the watermark.&amp;lt;ref name=&amp;quot;ss-apis&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Triggers, latency and throughput ===&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;trigger&amp;#039;&amp;#039;&amp;#039; decides when an engine computes and emits results. Engines that group records into small batches gain throughput and simpler fault tolerance, but each batch adds scheduling overhead that sets a floor on latency. Engines that keep long-lived tasks and handle each record as it arrives reach lower latency.&amp;lt;ref name=&amp;quot;ss-rtm&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/streaming/real-time-mode.html |title=Real-time Mode (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Execution models ==&lt;br /&gt;
{{Main|Structured Streaming}}&lt;br /&gt;
Two execution models are common:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Micro-batch&amp;#039;&amp;#039;&amp;#039;: the engine runs the query as a series of small batch jobs. This is the default in [[Structured Streaming]], with end-to-end latencies as low as about 100 milliseconds and exactly-once guarantees.&amp;lt;ref name=&amp;quot;ss-index&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/streaming/index.html |title=Structured Streaming Programming Guide (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Continuous or record-at-a-time&amp;#039;&amp;#039;&amp;#039;: long-running operators process each record as it arrives. Kafka Streams describes its processing as one record at a time, with millisecond latency.&amp;lt;ref name=&amp;quot;kstreams&amp;quot; /&amp;gt; Flink processes unbounded streams continuously and keeps state local to each task for low latency.&amp;lt;ref name=&amp;quot;flink-arch&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Spark offers three modes on the same DataFrame API. The Spark 4.3 documentation compares them as follows:&amp;lt;ref name=&amp;quot;ss-rtm&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Spark mode !! Typical latency !! Processing guarantee !! Supported queries&lt;br /&gt;
|-&lt;br /&gt;
| Micro-batch (default) || About 100 ms || Exactly-once || All streaming operations&lt;br /&gt;
|-&lt;br /&gt;
| Real-time Mode (Spark 4.1.0 and later) || Millisecond scale || Exactly-once || Stateless queries; since Spark 4.3.0 also deduplication, aggregation and JVM &amp;lt;code&amp;gt;transformWithState&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Continuous Processing (experimental) || About 1 ms || At-least-once || Map-like operations only; the documentation calls it legacy and points to Real-time Mode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In Real-time Mode, the trigger duration (default 5 minutes) is mainly a checkpoint interval, not a latency target; records are processed and emitted as they arrive.&amp;lt;ref name=&amp;quot;ss-rtm&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with batch processing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! Batch processing !! Stream processing&lt;br /&gt;
|-&lt;br /&gt;
| Input || Bounded; all data present at start || Unbounded; data keeps arriving&lt;br /&gt;
|-&lt;br /&gt;
| Completeness || Known when the job starts || Estimated, usually with a watermark&lt;br /&gt;
|-&lt;br /&gt;
| Output || Produced once, at the end || Produced incrementally and updated&lt;br /&gt;
|-&lt;br /&gt;
| Failure recovery || Rerun the job || Restart from a checkpoint and replay the source&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The boundary is not strict. Structured Streaming&amp;#039;s available-now trigger processes all data present at start and then stops, which runs a streaming query as an incremental batch job.&amp;lt;ref name=&amp;quot;ss-apis&amp;quot; /&amp;gt; In a [[streaming lakehouse]], the same table is written by a stream and read by batch queries.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Structured Streaming]]&lt;br /&gt;
* [[Watermark]]&lt;br /&gt;
* [[Exactly-once semantics]]&lt;br /&gt;
* [[Streaming lakehouse]]&lt;br /&gt;
* [[Spark Streaming (DStreams)]]&lt;br /&gt;
* [[Spark Declarative Pipelines]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Pipelines and orchestration]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>