# Stream Processing

> Each event is handled as it comes in. The answer is ready in seconds.

**Field:** Data Engineering  
**Category:** Foundations  
**Also known as:** Streaming Data Processing, Real-Time Processing, Event Stream Processing

## Think of it like

It is like a tap that is always on. You fill each cup the moment it is held out.

## Definition

Stream processing handles each piece of data as soon as it arrives. The data is a stream of small events, such as clicks or payments. A program reads the stream and acts on each event in seconds or less. It can count, filter or join events while they flow. It is fast, but it is harder to build and to fix than a batch.

## Example

A card company checks each payment as it happens. If a card is used in London and Tokyo within ten minutes, the second payment is blocked.

## Why it matters

Some answers are worthless if they come late. Fraud, stock levels and live maps all need data within seconds.

## Common mistake

Thinking stream means no delay at all. Events still come late or out of order, and the code has to handle that.

## Three principles

- **One event at a time.** Each event is handled as it comes.
- **Never done.** The job runs all the time.
- **Late events happen.** The code must expect data out of order.

## Related terms

- [Batch Processing](https://learn.benibix.com/term/data/batch-processing)
- [Micro-Batching](https://learn.benibix.com/term/data/micro-batching)
- [Kappa Architecture](https://learn.benibix.com/term/data/kappa-architecture)
- [Event-Driven Architecture](https://learn.benibix.com/term/development/event-driven-architecture)
- [Streaming Ingestion](https://learn.benibix.com/term/data/streaming-ingestion)
- [Backpressure](https://learn.benibix.com/term/data/backpressure)

## Told apart from

- [Batch Processing vs Stream Processing](https://learn.benibix.com/compare/batch-processing-vs-stream-processing): People think stream processing is always better because it is faster. A batch job runs on a pile of data at set times. A stream job handles each event as it comes. Streams cost more to build and to fix. Pick a stream only when a late answer is worth nothing.

## Taught in

- [Batch and Stream Processing](https://learn.benibix.com/learn/data-foundations/batch-and-stream-processing): Data Engineering Basics, 5/11

![Top row: events pile up in a box and one job runs on the whole pile at 2am. Bottom row: each event goes through the job the moment it arrives, one at a time.](https://learn.benibix.com/diagrams/batch-vs-stream.svg)

---

Source: https://learn.benibix.com/term/data/stream-processing
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
