AI-200 practice question 3 of 10

Your team is building an AI model serving application using Azure Cosmos DB for NoSQL as the vector database. The application stores embeddings for…

Full set: 67 questions
Your team is building an AI model serving application using Azure Cosmos DB for NoSQL as the vector database. The application stores embeddings for semantic search, but query performance has degraded significantly as the dataset grows beyond 1 million documents. You have analyzed the query patterns and found that most searches filter by a category field before computing vector similarity. Request Units (RUs) consumption is also higher than expected. Which two optimizations should you implement? (Choose two.)
Answer options
A: Create a composite index that includes the category field and the vector embedding property
B: Switch the consistency level from Strong to Eventual for all queries Correct answer
C: Implement a change feed processor to replicate vector embeddings to a secondary database
D: Configure the indexing policy to exclude the vector field from indexing but include the category field Correct answer
Correct Answer:
B. Switch the consistency level from Strong to Eventual for all queries; D. Configure the indexing policy to exclude the vector field from indexing but include the category field
Explanation

In Azure Cosmos DB for NoSQL, vector embeddings are large arrays. If not explicitly excluded from the standard indexing policy, Cosmos DB attempts to index every element, leading to excessive Request Unit (RU) consumption and storage costs. Vector indexes are defined separately, so the vector field must be excluded from standard indexing. Additionally, Strong consistency requires reading from a quorum, which doubles the RU cost for read operations compared to Eventual consistency. Switching to Eventual consistency reduces RU consumption and improves read latency.

Why Incorrect

A. Incorrect because Cosmos DB does not support composite indexes that combine scalar fields with vector embedding properties.
C. Incorrect because replicating data via change feed does not improve the query performance or reduce RU consumption of the primary database.

References

- Microsoft Learn: "Vector search in Azure Cosmos DB for NoSQL"

Section: Vector indexing policies. (https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/vector-search)

- Microsoft Learn: "Consistency levels in Azure Cosmos DB"

Section: Consistency levels and throughput. (https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels)

Scroll to Top