You are designing an Azure Cosmos DB Core (SQL) API container for a logistics monitoring system that tracks delivery fleet telemetry. The system receives data from active vehicles. Each vehicle is assigned to one of shipping carriers.
The telemetry documents contain the following fields:
- `vehicleId` (unique string identifier)
- `carrierId` (unique carrier code)
- `routeId` (unique route identifier)
- `timestamp` (date and time of the reading)
- `location` (latitude/longitude coordinates)
The system has the following requirements:
- Writes: Telemetry is ingested continuously at a rate of writes per second. Three large shipping carriers account for of all vehicle updates.
- Reads: Active tracking dashboards query vehicle locations for a specific route. These queries always filter by `routeId` and `timestamp`.
- Transactions: When a vehicle crosses a state line, the platform must execute a transactional batch operation to atomically update the vehicle status and insert a route checkpoint log.
Which partition key strategy should you select to meet these requirements while preventing hot partitions and optimizing query performance?
- AConfigure `vehicleId` as the partition key to maximize write distribution across all physical partitions.
- BConfigure `carrierId` as the partition key to group all telemetry for each shipping company together.
- Create a synthetic partition key that combines `routeId` and the date portion of the `timestamp` (for example, `routeId_date`).Answer
- DConfigure `vehicleId` as the partition key, and rely on Session consistency to guarantee transactional atomicity for the route checkpoint updates.