AZ-204 Develop Azure compute solutions Practice Question
Your company is developing a real-time dashboard that displays live metrics from IoT devices. The backend processes device data using Azure Functions with an Event Hubs trigger. The processed data is stored in Azure Cosmos DB. You need to ensure that the system can handle a sudden increase in device data without losing messages or overloading Cosmos DB. The solution must minimize latency and cost. What should you do?
⚠ Common exam trap
It's easy for candidates to assume increasing throughput or batch size is the simplest solution, but the exam tests the understanding that decoupling ingestion from processing with a buffer is the correct way to handle sudden load spikes while minimizing cost and latency.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Implement a buffer using Azure Blob storage: the Event Hubs triggered function writes raw data to blobs, and a separate timer-triggered function batches and writes to Cosmos DB at a controlled rate.
It decouples the ingestion rate from the write rate to Cosmos DB. By buffering raw data in Azure Blob storage and using a timer-triggered function to batch-write at a controlled rate, the system can absorb sudden spikes in device data without overwhelming Cosmos DB or losing messages. This approach minimizes latency by keeping the Event Hubs trigger processing fast (writing to blob) and reduces cost by avoiding the need to over-provision RU/s on Cosmos DB.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Implement a buffer using Azure Blob storage: the Event Hubs triggered function writes raw data to blobs, and a separate timer-triggered function batches and writes to Cosmos DB at a controlled rate.
Why this is correct
This strategy effectively decouples the high-ingestion rate of Event Hubs from the potentially lower write capacity of Cosmos DB. The Event Hubs triggered function rapidly writes raw, unbatched data to inexpensive Azure Blob storage, acting as a temporary buffer. A separate timer-triggered function then reads these blobs, aggregates data into larger batches, and writes them to Cosmos DB at a controlled, sustainable rate, preventing throttling and optimizing RU/s consumption. This approach ensures data durability and cost-efficiency by leveraging Blob storage for buffering and batching writes to Cosmos DB.
- ✗
Configure the Event Hubs trigger to use a checkpointing strategy with a larger batch size to reduce the number of function invocations.
Why it's wrong here
While increasing the Event Hubs trigger's batch size can reduce function invocations and potentially improve efficiency, it does not inherently prevent Cosmos DB from being overloaded. The aggregate write rate to Cosmos DB might still exceed its provisioned throughput, leading to throttling, especially during peak loads. Checkpointing is crucial for ensuring reliable message processing and preventing data loss or reprocessing in Event Hubs, but it's a mechanism for fault tolerance, not for managing downstream database write capacity or controlling the rate at which data is persisted.
- ✗
Use Azure Stream Analytics to process the Event Hubs data and write directly to Cosmos DB.
Why it's wrong here
Azure Stream Analytics is a powerful real-time analytics engine capable of processing high-throughput data from Event Hubs. However, directly writing its output to Cosmos DB without an explicit buffering or rate-limiting mechanism can still lead to Cosmos DB throttling if the Stream Analytics output rate consistently exceeds the database's provisioned RU/s. While Stream Analytics can scale, it introduces additional operational complexity, cost, and potential latency compared to a simpler function-based buffering solution, and it doesn't solve the fundamental problem of mismatched write capacities.
- ✗
Increase the provisioned throughput (RU/s) on the Cosmos DB container to handle peak loads.
Why it's wrong here
Increasing Cosmos DB's provisioned throughput (RU/s) is a direct way to handle higher write volumes, but it comes with a significant increase in cost, as RU/s are billed continuously. Furthermore, simply increasing RU/s might not be sufficient to handle unpredictable peak loads, potentially leading to continued throttling if the burst exceeds the new capacity. This approach also fails to address the fundamental architectural challenge of decoupling a high-ingestion stream from a database with potentially fluctuating or limited write capacity, and it doesn't inherently prevent data loss from Event Hubs if the downstream system cannot keep up.
Quick reference
Azure Blob Storage Tier Comparison
| Tier | Storage Cost | Retrieval Cost | Latency | Use Case |
|---|---|---|---|---|
| Hot | Highest | Lowest | Immediate | Active data, frequent reads |
| Cool | Lower | Higher | Immediate | Data accessed < once / month |
| Cold | Lower still | Higher | Immediate | Data accessed < once / quarter |
| Archive | Lowest | Highest + rehydration delay | Hours | Long-term compliance retention |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Durable Functions
Durable Functions is an extension of Azure Functions that lets you write stateful workflows in code, managing complex sequences of tasks, retries, and delays automatically.
Key term
Azure Functions Bindings
Azure Functions Bindings are declarative connections that link your serverless function code to Azure services or external resources, handling input and output data automatically without writing extra networking or authentication code.
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.