Contoso is building a product catalog for its e-commerce site on Azure Cosmos DB. A laptop record has about 15 properties, while a gift card record has only 5. The merchandising team adds new attributes to product types every few weeks. All products will be stored in one container, and developers do not want to change a schema each time a product type gains an attribute.
Which characteristic of Azure Cosmos DB makes it suited to this use case?
Cosmos DB does not require items in a container to share a structure, so one item can have 5 properties and another 15. This makes it well suited to workloads like a product catalog where record shapes differ and change over time. Cosmos DB also indexes all properties by default, so new attributes need no schema or index work. The other options describe real features, but none addresses varying record structure.
- Not correct: Serverless capacity bills for the request units consumed. Serverless mode is a billing and capacity choice for intermittent traffic; it has nothing to do with varying record structure.
- Not correct: Consistency levels can be tuned for replicas in many regions. Consistency levels control how up to date replica reads are; they do not let records with different properties share a container without schema changes.
- Not correct: Throughput can be shared at the database level across containers. Shared throughput spreads provisioned RU/s across up to 25 containers; it does not address records with different structures.
- Not correct: Logical partitions spread data based on a chosen partition key. The partition key distributes data across logical partitions for balanced throughput; schema flexibility is what permits items with different structures.
- Correct: Items in one container can each have a different structure. Cosmos DB is schema-agnostic, so records with different and changing sets of properties can sit in the same container without a predefined schema.