You are designing an Azure Cosmos DB container to store chat messages for a multi-tenant enterprise collaboration application. The application supports thousands of corporate tenants, each containing numerous distinct chat channels.
The workload has the following characteristics:
- Writes are heavy and occur continuously across all active channels.
- The most frequent query retrieves the history of a specific chat channel, sorted by timestamp.
- The application uses transactional batch operations to insert, update, or delete multiple messages within a single channel as an atomic unit.
- A single tenant's data can exceed over time, whereas any individual channel's data is guaranteed to remain under .
You need to select a partition key that ensures scalability, avoids hot partitions, and supports the transactional requirements.
Which partition key strategy should you implement?
- AUse the tenant ID as the partition key.
- Create a synthetic partition key by combining the tenant ID and the channel ID.Cevap
- CUse the message ID as the partition key.
- DUse the sender ID as the partition key.