QuestionQ102

Design and implement data distribution

You have an Azure subscription containing an Azure Cosmos DB for NoSQL database named DB1.

You develop a software-as-a-service (SaaS) app named App1 that uses DB1. App1 will be used by multiple vendors to manage their customers.

You need to create a container in DB1 to store customer and order details for each vendor. The solution must meet these requirements:

  • Each vendor must have a unique tenant ID.
  • Container performance must be optimized for reads.
  • Customer IDs can be duplicated across the container, but they must be unique for each vendor.
  • The container must be optimized for concurrent queries from multiple customers. Each query will return data for one vendor.

How should you configure the container?

  • A Add a partition key to the tenant ID and a unique key policy to the customer ID.
  • B Add hierarchical partition key on (tenant identifier, customer identifier).
  • C Add a partition key to the customer ID and a unique key policy to the tenant ID.
  • D Add hierarchical partition key on (customer identifier, tenant identifier).
Explanation

A hierarchical partition key ordered as tenant identifier followed by customer identifier is suited to a read-heavy multitenant workload. The tenant identifier first allows queries filtered to a vendor to be routed only to that tenant’s relevant subpartitions, rather than fanning out across the container. The tenant/customer combination scopes customer identities within a vendor and distributes that vendor’s customer and order data across subpartitions, supporting concurrent reads.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!