You are designing an Azure Cosmos DB Core (SQL) API solution for a smart city traffic management platform. The platform collects real-time vehicle telemetry from traffic sensors deployed across major cities.
Workload Profiles:
- Write Ingestion: Highly write-heavy. Each sensor transmits telemetry (including `sensorId`, `cityName`, `timestamp` in `YYYY-MM-DD hh:mm:ss` format, and `vehicleCount`) every seconds. Write volume peaks heavily during rush hours.
- Read Queries: Real-time traffic control dashboards query the most recent minutes of telemetry data for a specific city to adjust traffic light timings (high-frequency, low-latency reads).
- Transactional Boundary: A stored procedure must run atomically to update both the daily aggregate vehicle count and the latest telemetry record for a specific sensor.
You need to select the partitioning strategy that avoids the hot partition problem for writes, satisfies the transactional requirements, and minimizes Request Unit (RU) consumption for read queries.
Which two strategies should you implement? (Select two.)
- Define a synthetic partition key for the primary container by concatenating the sensorId and the date portion of the timestamp (e.g., sensorId_YYYY-MM-DD).Cevap
- Use the Azure Cosmos DB Change Feed to replicate telemetry data to a secondary container partitioned by cityName to serve the dashboard queries.Cevap
- CDefine the partition key as cityName on the primary container.
- DUse the date portion of the timestamp (e.g., YYYY-MM-DD) as the partition key for the primary container.
- EDefine the partition key as sensorId on the primary container and execute multi-partition transactions to update daily aggregates.