You are implementing CQRS and Event Sourcing for a high-throughput order system. Commands store events in an append-only stream per aggregate in Azure Cosmos DB. You must build multiple read models (searchable orders in Azure SQL and a hot cache) and also publish a subset of events to external consumers for analytics with replay capability. Which two components should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Use the Azure Cosmos DB change feed processor to trigger Azure Functions that project events into read models (e.g., Azure SQL Database and Azure Cache for Redis), ensuring idempotent upserts., Publish selected events to Azure Event Hubs for external consumers and analytics, configuring retention to support near-real-time processing and limited replay..
Why this is the answer
The Azure Cosmos DB change feed processor reliably captures all changes to your event store, making it ideal for triggering Azure Functions. These functions can then project events into various read models like Azure SQL Database (for searchable data) and Azure Cache for Redis (for a hot cache). Idempotent upserts are crucial to handle potential retries and ensure data consistency in the read models. Azure Event Hubs is a highly scalable data streaming platform perfect for publishing events to external consumers. Its configurable retention period allows for both near-real-time processing and limited replay capabilities for analytics. Writing commands directly to Azure SQL Database would bypass the event store and defeat the purpose of Event Sourcing. Azure Storage Queues are not designed as a primary event store for Event Sourcing due to limitations in querying and append-only guarantees compared to Cosmos DB. Disabling idempotency is risky because while the change feed processor aims for once-only delivery, network issues or function retries can lead to duplicate processing, corrupting read models without idempotent operations.
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