Stream processing explained in plain terms is the analysis of data continuously, as it arrives, rather than waiting for it to pile up and analysing it later in a batch. The central question is how a system can react to something within seconds of it happening, and the short answer is that each new record is processed the moment it arrives, through a pipeline of small steps that filter, combine and summarise it, so the result is ready while the data is still fresh.
Most data work is batch work: collect a day’s orders, run a report overnight, and read the results in the morning. That is fine when the answer can wait. It is not fine when the answer is needed now: a fraudulent payment must be stopped before it completes, a failing machine must be flagged before it breaks, and a driver needs to know about traffic on the road ahead, not yesterday. Stream processing exists for those cases, where the value of the data fades with every minute it sits unprocessed. Our guide to cloud event streaming explains the platforms that carry the streams these systems process.
Key takeaways
- Stream processing analyses data continuously as it arrives, instead of waiting to process it in batches.
- It suits decisions that lose value with delay: fraud detection, monitoring, alerts and live dashboards.
- Data is processed through a pipeline of small steps that filter, transform, join and aggregate records.
- Windows group records by time so the system can compute totals and averages over recent minutes or hours.
- Streams are never finished, so the system must handle late, missing and out-of-order records as a normal condition.
What stream processing is
Stream processing is the continuous processing of unbounded data. A stream is a sequence of records that keeps coming: clicks, payments, sensor readings, log lines. Unlike a file, a stream has no end, and unlike a batch job, a stream processor never finishes and reports back. It runs all the time, taking each record as it arrives, applying a series of operations to it, and producing results that update continuously.
The operations are the familiar ones from data work: filter out records that do not match, transform fields into the form downstream systems need, join a record with reference data, and aggregate records into counts, sums and averages. The difference is that these operations run on data in motion, one record at a time, and the results are produced incrementally. A dashboard showing the number of orders in the last hour is not recomputed from scratch each time; it is updated as each new order arrives and as old orders fall out of the window.
Streams and batches
Batch processing and stream processing answer different questions. A batch job looks at a fixed set of data, such as everything from yesterday, and produces a complete, exact answer. A stream processor looks at data as it arrives and produces an answer that is always current but always provisional, because more data is still coming. The batch answer is final; the stream answer is the best available right now.
In practice, the two are often combined. A stream processor handles the live view, flagging fraud and updating dashboards within seconds, while a batch job later recomputes the same results from the full stored data, correcting any errors and producing the authoritative figures for reporting. This combination is common because the two approaches cover each other’s weaknesses: streaming is fast but approximate, batch is slow but exact.
Windows: how streams handle time
Aggregation over a stream needs a window, because a stream never ends and a total over everything would grow forever. A window is a slice of time, such as the last five minutes, or the last hour, and the system computes its totals over that slice. A tumbling window divides time into fixed, non-overlapping slices, such as each hour on the hour. A sliding window moves continuously, such as the last ten minutes, updated every minute. A session window groups records by activity, closing when there is a gap, which suits user behaviour where a session is a burst of activity followed by silence.
Windows create their own problems. Records can arrive late, after the window they belong to has already closed, and the system must decide whether to update the published result or ignore the late record. Clocks on different machines can disagree, so two records that happened in one order can arrive in another. Stream processors handle this with watermarks, which are signals about how complete the data for a given time is, letting the system wait a little for late records before closing a window, and then either accept corrections or move on.

Comparing stream processing with batch processing
| Aspect | Stream processing | Batch processing | When it wins |
|---|---|---|---|
| Latency | Seconds or less | Minutes to hours | Streaming for immediate action |
| Data | Unbounded, never ends | Fixed set, complete | Batch for final, exact figures |
| Results | Always current, provisional | Final and complete | Streaming for live dashboards |
| Failures | Must recover without losing place | Can simply rerun the job | Batch for simple recovery |
| Complexity | Higher, handles time and order | Lower, data is static | Batch when answers can wait |
Where stream processing is used
Stream processing is used wherever a fast reaction matters. In payments, it scores transactions as they happen and blocks the ones that look fraudulent before they complete. In operations, it watches logs and metrics from thousands of machines and raises alerts when something drifts from normal. In transport, it updates arrival times and traffic conditions from live vehicle data. In retail, it updates recommendations and stock levels as customers browse and buy.
It is also used to keep systems in sync. When a record changes in one system, the change travels as a stream event to every other system that needs it, so a search index, a recommendation service and a reporting store all stay current without polling the source. Our guide to event-driven architecture in the cloud explains the pattern behind this, and our guide to data lakes covers where the same data is stored for later batch analysis.
What stream processing cannot do
Stream processing has real limits. The hardest is that its results are approximate by nature. Late records, out-of-order records and failures mean that a streaming total may differ from the total a batch job later computes from the complete data. Systems that need exact figures, such as financial reporting, still rely on batch jobs to produce the authoritative numbers, with streaming used for the live view and the alerts.
It is also complex to operate. A stream processor must keep state, meaning the information it needs to compute its results, such as running totals and the contents of windows. That state must survive restarts, be recoverable after failures, and be correct even when records are delivered more than once. Getting this right takes careful design, and a stream pipeline that loses state or double-counts records produces numbers that look plausible and are wrong.
What good practice looks like
Good practice starts with choosing the right tool for the question. If the answer can wait until tomorrow, a batch job is simpler and more reliable. Stream processing is worth its complexity only where the value of the answer fades quickly, or where a slow reaction is a real cost. Teams that stream everything, including reports nobody reads until the next day, pay for complexity they do not need.
Good practice also means designing for the realities of streams from the start: late and out-of-order records, duplicate deliveries, and failures that interrupt processing. Results should be defined so that a late record corrects an earlier result rather than corrupting it, and the system should be tested by replaying real data, including its messiness, before it is trusted with live decisions. Monitoring covers the flow itself: how far behind each stage is, how many records are late, and how often results are corrected.
Stream processing checklist
- Use streaming only where the value of the answer fades quickly; use batch where the answer can wait.
- Choose window types that match the question: tumbling for fixed periods, sliding for rolling views, session for bursts of activity.
- Plan for late and out-of-order records, and decide whether results are corrected or frozen when they arrive.
- Design processing to be safe when a record is delivered more than once.
- Keep state durable and recoverable, so a restart does not lose running totals.
- Combine streaming with batch: live views from the stream, authoritative figures from the batch job.
- Test with replayed real data, including its messiness, before trusting the pipeline with live decisions.
- Monitor lag at every stage, so a slow consumer is noticed before the backlog becomes a crisis.
- Document what each stream contains and what each result means, so consumers trust the numbers.
Frequently asked questions
What is stream processing?
Stream processing is the continuous analysis of data as it arrives, rather than in batches after the fact. Each record passes through a pipeline of operations that filter, transform, join and aggregate it, so results update within seconds and stay current while the data is still fresh.
How is stream processing different from batch processing?
Batch processing works on a fixed set of data and produces a complete, final answer, but only after the data has accumulated. Stream processing works on data as it arrives and produces results within seconds, but those results are provisional, because more data is still coming. The two are often combined: streaming for the live view, batch for the authoritative figures.
What is a window in stream processing?
A window is a slice of time over which the system computes totals, such as the last five minutes or the last hour. Because a stream never ends, aggregation needs a window to bound the calculation. Tumbling windows are fixed and non-overlapping, sliding windows move continuously, and session windows group records by bursts of activity.
What is a watermark?
A watermark is a signal about how complete the data for a given time is. It lets a stream processor wait a little for late records before closing a window, balancing the need for timely results against the need to include records that arrive after the time they belong to.
Why are streaming results sometimes wrong?
Because records can arrive late, out of order, or more than once, and because failures can interrupt processing. A streaming total is the best available answer from the data seen so far, and it may differ from the total a batch job later computes from the complete data. Systems that need exact figures use batch jobs for the final numbers.
When should I not use stream processing?
Do not use it when the answer can wait, when exact figures are required, or when the data is small and simple. The complexity of handling time, order, state and recovery is only worth paying when a fast reaction has real value, such as stopping fraud or alerting on a failure.
The bottom line
Stream processing explained in one line is this: by analysing each record the moment it arrives, through windows that bound the calculation and pipelines built to survive late records and failures, systems can react within seconds to things that matter now, while batch jobs still produce the exact figures that matter later.







