Choose a batch window or a streaming response
Separate receiving a stream from processing events, handling lateness and serving results.
A refrigerated truck loses signal
A sensor buffers readings and uploads them after connectivity returns. A dashboard counts threshold crossings per minute. Which timestamp should determine the minute of a historical crossing?
Batch and streaming
A batch has a bounded set of records to process. A stream continues as new events arrive. Event time is when an observation happened and arrival time is when the platform received it. Choose a window, late-data policy and duplicate-handling strategy that match the business question.
Real-time services
Azure Event Hubs can ingest events. Azure Stream Analytics can apply streaming queries and windows. Fabric Real-Time Intelligence supports eventstreams and analytical querying in a real-time environment. Separate the intake service, computation and destination required for the result.
Work through the decision
Compare your reasoning
Use the sensor event time for the historical bucket. Decide how late a reading can update a previous result and label provisional totals. For an immediate operational alarm also track arrival time so staff understand when the system could have acted.
Change one constraint
The same buffered reading arrives twice. What else does an event-time window need?
Check your answer
Use a stable event identifier or another supported deduplication policy within an appropriate retention boundary. Assigning both copies to the correct minute does not remove the duplicate.
Replay a delayed reading
A gateway records event minute, arrival minute and event ID. The last row is a repeated delivery. Trace the number of unique events by occurrence minute. Run this locally with Python 3 or trace the example on paper.
from collections import Counter
deliveries = [(8, 8, 'a'), (8, 12, 'b'), (9, 9, 'c'), (8, 13, 'b')]
seen = set()
by_event_minute = Counter()
for event_minute, arrival_minute, event_id in deliveries:
if event_id not in seen:
seen.add(event_id)
by_event_minute[event_minute] += 1
print(sorted(by_event_minute.items()))
Check your result
Minute 8 contains two events and minute 9 contains one. The second delivery of b does not create another occurrence. A production design must decide how long to hold deduplication state and whether a late event may revise a published window.
Revisit the recording
The Hadoop, Kafka and HDInsight survey illustrates distributed processing and event streams. Receiving events and calculating a rolling result are separate jobs. Hadoop Systems · 2:48:29.
Sources and further practice
Microsoft exam objectives · Microsoft documentation for this case.
Structured Streaming · Data Engineer Associate · Return to the study map.
Choose a batch window or a streaming response quiz
Answer 5 questions. Check each answer for an explanation.