Batch, Streaming & Real-Time
Batch vs stream processing · latency · lambda architecture · source, query, sink · Fabric Real-Time Intelligence · Stream Analytics · Event Hubs · Spark Structured Streaming
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Batch vs stream processing
Data processing is the conversion of raw data to meaningful information. There are two general ways to do it: batch and stream.
| Aspect | Batch processing | Stream processing |
|---|---|---|
| How data is handled | Multiple records are collected and stored, then processed together in a single operation | A source is constantly monitored and each new piece of data is processed when it arrives |
| Data scope | Can process all the data in the dataset | Typically only the most recent data, or a rolling time window (the last 30 seconds, for example) |
| Data size | Suitable for large datasets | Individual records or micro batches of a few records |
| Latency | Typically a few hours | Immediate: seconds or milliseconds |
| Typical analysis | Complex analytics | Simple response functions, aggregates, or calculations such as rolling averages |
| Fits | Large volumes processed at a convenient time, for example overnight | Time-critical operations that need an instant real-time response |
- Batch example from Learn: credit card companies send one monthly bill for all of that month's purchases, not a bill per purchase.
- Stream examples from Learn: tracking stock market changes in real time, analyzing player-game interactions, and recommending properties from a phone's location.
- Batch drawbacks listed on Learn: all input data must be fully prepared before processing starts, there is often a delay before results, and errors can stop the whole batch.
Latency is the time taken for the data to be received and processed.
Combining batch and stream
Many large-scale analytics solutions include a mix of batch and stream processing, which supports both historical and real-time analysis.
- Stream processing can capture real-time data, filter or aggregate it, and show it in real-time dashboards, while also saving the processed results in a data store for historical analysis.
- Even when real-time analysis is not required, streaming technologies are often used to capture real-time data and store it for later batch processing.
- A lambda architecture is a common pattern for combining batch and stream processing. Lambda and delta architectures are common; the kappa architecture is a simpler alternative that drops the separate batch layer.
- Non-streaming data is often kept in a data lake for batch processing; batch results are persisted in an analytical data store (often called a data warehouse).
Elements of a stream processing solution
- An event generates data (a sensor signal, a social media message, a log entry).
- The data is captured in a streaming source: a folder, a table, or, in more advanced solutions, a queue that encapsulates logic to ensure events are processed in order and each only once.
- The data is processed, often by a perpetual query that selects events, projects values, or aggregates values over time-based periods called windows.
- The results go to an output, or sink: a file, a database table, a real-time dashboard, or another queue.
| Role | Azure services Learn lists |
|---|---|
| Sources | Azure Event Hubs, Azure IoT Hub, Azure Data Lake Storage Gen2, Apache Kafka |
| Sinks | Azure Event Hubs, Azure Data Lake Storage Gen2, Microsoft OneLake, Azure Blob Storage, Azure SQL Database, Azure Databricks, Microsoft Fabric, Microsoft Power BI |
Microsoft services for real-time analytics
| Service | What it is |
|---|---|
| Microsoft Fabric Real-Time Intelligence | An integrated set of tools for real-time data built into Microsoft Fabric |
| Spark Structured Streaming | An open-source library for streaming solutions on Apache Spark based services, including Azure Databricks and Microsoft Fabric |
| Azure Stream Analytics | A platform-as-a-service (PaaS) service to define streaming jobs that ingest from a source, apply a perpetual query, and write to an output; standalone or hybrid streaming outside of Fabric |
| Azure Event Hubs | Ingests high volumes of event data; a fully managed, real-time data streaming platform |
| Azure IoT Hub | Like Event Hubs, but optimized to manage event data from Internet of Things (IoT) devices |
Learn says real-time does not mean high rate: your data does not have to flow at high rates and volumes to use Real-Time Intelligence.
Fabric Real-Time Intelligence components
| Component | Purpose |
|---|---|
| Real-time hub | A centralized catalog for your organization to find, add, explore, and share streaming data |
| Eventstreams | Ingest, route, and transform streaming data, without writing code |
| Eventhouse | A database optimized for time-series and event data, queried using KQL (Kusto Query Language) |
| Real-Time Dashboards | Live data visualization |
| Activator | Triggers automated actions or alerts when streaming data meets defined conditions |
Spark Structured Streaming and Delta tables
- Spark runs on Microsoft Fabric and Azure Databricks, and handles both batch and stream processing.
- Spark Structured Streaming reads a source into a dataframe, runs a query on it, and writes the results to an output (a sink).
- It is a good choice when you already use Spark for data processing and want to add real-time streams.
- Delta Lake is an open-source storage format that improves how data is stored in a data lake. One Delta table can be both a streaming sink and a source for batch queries.
Exam Tips
Tick each tip once you can answer it without looking.
“Records are collected and stored, then processed together in one operation” → Batch processing. Trap: Stream processing handles each new piece of data as it arrives.
“Each new data event is processed as soon as it arrives” → Stream processing. Trap: Batch waits for the whole group to be collected.
“Latency of a few hours is typical” → Batch processing. Trap: Stream latency is in seconds or milliseconds.
“Latency in seconds or milliseconds” → Stream processing. Trap: Batch latency is typically a few hours.
“Complex analytics over the whole dataset” → Batch processing. Trap: Streams typically see only recent data or a rolling window and do simple aggregates such as rolling averages.
“Smoke and heat monitor must trigger alarms at once” → Stream processing (time-critical operations). Trap: Batch gives no results until a batch is processed.
“One monthly bill for all purchases” → Batch processing. Trap: This is the Learn example for batch; a bill per purchase would be stream-like.
“Mix of historical and real-time analysis, common pattern” → Lambda architecture (also delta). Trap: Kappa is the simpler alternative with no separate batch layer.
“Stream processing building blocks” → Source, perpetual query (windows), sink. Trap: A sink is the output, not the input.
“Integrated real-time tools inside Microsoft Fabric” → Real-Time Intelligence. Trap: Azure Stream Analytics is a PaaS service that also works outside of Fabric.
“Fabric database for time-series and event data, queried with KQL” → Eventhouse. Trap: Eventstreams ingest, route, and transform streaming data.
“Ingest, route and transform streams in Fabric without code” → Eventstreams. Trap: Eventstreams ingest, route, and transform streaming data.
“Trigger an alert or action when streaming data meets a condition” → Activator. Trap: Real-Time Dashboards are for live data visualization.
“Ingest high volumes of event data” → Azure Event Hubs. Trap: IoT Hub is the variant optimized for IoT device data.
“Manage event data from IoT devices” → Azure IoT Hub. Trap: Event Hubs is the general high-volume ingestion service.
“Fully managed PaaS service for streaming jobs with a SQL-like query language” → Azure Stream Analytics. Trap: Spark Structured Streaming is a library you code on Spark services.
“Streaming on Spark in Azure Databricks or Fabric” → Spark Structured Streaming. Trap: Azure Stream Analytics is a PaaS service that defines streaming jobs.
Sources
- Understand batch and stream processing
- Explore common elements of stream processing architecture
- Explore Microsoft Fabric Real-Time Intelligence
- Explore Apache Spark structured streaming
- What is Real-Time Intelligence in Microsoft Fabric?
- Introduction to Azure Stream Analytics
- What is Azure Event Hubs
Checked against Microsoft Learn on November 13, 2026.