Q37 Cosmos DB Domain 2 · 25–30% of exam

An application stores customer profiles in Cosmos DB NoSQL. Queries filter by both country (low cardinality, 50 values) and userId (high cardinality, millions). What is the best partition key?

  1. A country
  2. B userId (correct answer)
  3. C country_userId (composite synthetic key)
  4. D A random GUID

Shortcut: userId offers high cardinality ensuring even distribution. country alone creates hot partitions (only 50 partitions). A synthetic composite key is useful when queries need both fields together.