You are designing an Azure Cosmos DB Core (SQL) API container for a health technology platform that tracks daily patient health metrics during clinical trials.
Each document in the container contains the following fields:
- `tenantId`: A unique identifier for the pharmaceutical sponsor
- `trialId`: A unique identifier for the clinical trial
- `patientId`: A unique identifier for the patient
- `recordDate`: The date of the measurement in `YYYY-MM-DD` format
- `heartRate`: The patient's heart rate value
The database solution must meet the following requirements:
- Write Ingestion: High-frequency writes from thousands of patient devices uploading metrics concurrently. Write operations for a single patient's daily metrics must be executed as a transactional batch to ensure atomicity.
- Read Queries: Clinical researchers frequently query all metrics for a specific clinical trial (`trialId`) within a date range of to days.
- Scalability: Individual logical partitions must not exceed the storage limit, and write throughput (RUs) must be distributed evenly to avoid rate-limiting.
Which partition key strategy should you implement?
- ASet the partition key to the `patientId` field.
- BSet the partition key to the `trialId` field.
- Create a synthetic partition key by concatenating the `trialId` and `recordDate` fields.Answer
- DSet the partition key to the `tenantId` field.