Skip to main content

AI-200 practice question · Develop AI Solutions by Using Azure Data Management Services

A team stores each chat conversation as a single item in an Azure Cosmos DB for NoSQL container, partitioned by…

A team stores each chat conversation as a single item in an Azure Cosmos DB for NoSQL container, partitioned by conversation ID. New messages are appended to the item's messages array. This fits their access pattern of reading and writing one whole conversation at a time. What should they plan for as some conversations become very long?

  • AEach item is capped at 2 MB, so an ever-growing conversation item will eventually be rejected on write; plan to store messages as separate items or archive older turns.
  • BEach logical partition is capped at 20 GB, so the team should change the partition key to user ID before any single conversation item grows past that size.
  • CLarge items raise the RU cost of each read, so the team should switch the container to autoscale throughput, which lifts the per-item size limit for large items.
  • DCosmos DB automatically compresses large items and splits them across physical partitions, so the team only needs to watch storage costs as conversations grow.
Show the answer and explanation

Correct answer: A) Each item is capped at 2 MB, so an ever-growing conversation item will eventually be rejected on write; plan to store messages as separate items or archive older turns.

An Azure Cosmos DB for NoSQL item can be at most 2 MB. Storing a whole conversation in one ever-growing item eventually requires splitting messages into separate items or archiving older ones.

Why each option is right or wrong

  • A) Correct. In Azure Cosmos DB for NoSQL, the maximum item size is 2 MB, measured as the UTF-8 length of the JSON. An item that grows without limit will eventually exceed that, so the design needs a plan such as storing messages as separate items under the same partition key or moving older messages out.
  • B) Incorrect. The 20 GB limit applies to all items in a logical partition. A single item hits the 2 MB item limit long before that. Changing the partition key to user ID would also put more data into each logical partition, which makes the 20 GB limit harder to stay under.
  • C) Incorrect. Autoscale changes how throughput (RU/s) scales. It does not change the 2 MB per-item limit, which applies under every throughput mode.
  • D) Incorrect. Cosmos DB does not split a single item across partitions. An item larger than 2 MB is rejected, so the application has to handle splitting or archiving itself.
Question type
Multiple choice (one answer)

Practise the full AI-200 exam

This question is one of a small free sample from the CertRidge AI-200 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.