An IoT Kafka stream averages ~5000 msgs/s. Create an alert as soon as the 1-hour moving average drops below 4000 msgs/s. What should you implement?
Choose an answer
Tap an option to check your answer.
Correct answer: Use Dataflow with Kafka IO, a sliding 1-hour window every 5 minutes, compute the average at each slide, and alert if <4000.
Why this is the answer
The correct option uses Dataflow with a sliding window, which is ideal for calculating a moving average over a continuous stream. A 1-hour sliding window that advances every 5 minutes ensures the average is re-evaluated frequently (every 5 minutes) based on the most recent 1-hour data, allowing for timely alerts. The incorrect option using a fixed 1-hour window would only compute the average once every hour when the window closes, leading to significant delays in detecting a drop below the threshold. The other incorrect options involve Kafka Connect, Pub/Sub, and then either Bigtable or BigQuery, followed by Cloud Scheduler to query and alert. This approach introduces unnecessary complexity, latency, and cost for a real-time moving average calculation, as it relies on batch processing (Cloud Scheduler queries) rather than continuous stream processing.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed