Answers
- In Cosmos DB a partition key is required. It is fundamental to allowing the database to scale outwards or horizontally with increasing size and throughput.
- There are numerous reasons for this. You may want to be able to differentiate between different entities to all you to store them in the same container. They may also have different access patterns. However, in those scenarios it's often better to just store them in a different container.
- If you mean when would you mix different entities within a logical partition, you would do this when the data is typically accessed together.
- Having lots of logical partitions is not a concern. You can have an infinite number of logical partitions. Containers where the partition key is the /id is fundamentally a key/value store.
For people that are new to this type of database I strongly recommend watching this. It will give you a solid understanding of how to model and partition data in Cosmos DB so you can have high performance and high efficiency. https://youtu.be/3gEytt-Jops?t=1511