Azure Cosmos DB is a globally distributed, multi-model database service designed for high availability and low latency. Chapter 3 explores critical topics such as designing efficient data models, implementing effective partitioning strategies, configuring indexing policies, and managing RU consumption. These Azure Cosmos DB MCQ questions and answers are ideal for developers and database administrators aiming to optimize performance and scalability. Enhance your knowledge with these carefully crafted questions covering logical and physical partitioning, indexing policies, and RU cost optimization, ensuring you’re well-prepared for real-world applications and Azure certification exams.
Multiple-Choice Questions (MCQs)
Designing Efficient Data Models for Cosmos DB
What is the key principle of designing data models in Azure Cosmos DB? a) Normalization of data b) Data denormalization and entity grouping c) Strictly relational modeling d) Indexing all fields
Which factor is most critical in Cosmos DB data modeling for performance? a) Entity size b) Network latency c) Partition key selection d) Query parameter length
What is a key advantage of embedding data in Cosmos DB models? a) Reduced query complexity b) Increased storage requirements c) Reduced partitioning efficiency d) Improved write latency
How should relationships between entities be modeled in Cosmos DB? a) By using joins across multiple containers b) By embedding or referencing data c) By creating a foreign key constraint d) By using normalization
What is an anti-pattern in Cosmos DB data modeling? a) Using a single partition key for all entities b) Denormalizing data for performance c) Embedding related entities d) Indexing frequently queried fields
Partitioning Strategies and Best Practices
What determines the partitioning strategy in Azure Cosmos DB? a) Query cost and throughput requirements b) Storage capacity of each partition c) Network bandwidth d) Indexing policy
Which attribute is ideal for selecting a partition key? a) High cardinality and evenly distributed values b) Low cardinality with fixed values c) Attributes with NULL values d) Non-unique attributes
What is the maximum size of a physical partition in Cosmos DB? a) 10 GB b) 50 GB c) 100 GB d) 500 GB
Which of the following is NOT a good practice for partitioning? a) Choosing a partition key with a wide range of unique values b) Avoiding hot partitions c) Using GUIDs as partition keys for all workloads d) Designing partitions for query efficiency
What happens when the data in a partition exceeds its maximum size? a) The partition is split automatically b) Data is deleted to make space c) Queries are redirected to other partitions d) The throughput decreases
Logical and Physical Partitioning
Logical partitions in Cosmos DB are determined by: a) Indexing policies b) Partition key values c) The number of physical partitions d) Storage tier configuration
Physical partitions in Cosmos DB are used to: a) Store data across multiple Azure regions b) Manage logical partition distribution c) Handle only backup and recovery d) Execute transactions sequentially
How are partition keys related to physical partitions? a) They ensure data is evenly distributed across physical partitions b) They group all data into a single physical partition c) They have no impact on physical partitions d) They only affect query indexing
Which factor does NOT affect the number of physical partitions? a) Total provisioned RU/s b) Data size in the container c) Number of logical partitions d) Region count
What is the default size limit for a single logical partition? a) 10 GB b) 20 GB c) 100 GB d) Unlimited
Indexing Policies and Indexing Modes
What is the default indexing policy in Cosmos DB? a) No indexing b) Lazy indexing c) Automatic indexing of all fields d) Manual indexing
Which indexing mode minimizes RU consumption for write operations? a) Lazy indexing b) Exclusion indexing c) Consistent indexing d) None indexing
What is a composite index in Cosmos DB used for? a) Optimizing queries with multiple filters b) Improving storage efficiency c) Distributing data across regions d) Managing partition splits
How can indexing be disabled for specific fields in a container? a) By using composite indexes b) By excluding them in the indexing policy c) By setting partition key constraints d) By modifying the RU configuration
Which tool can be used to view and modify Cosmos DB indexing policies? a) Azure Monitor b) Azure Portal c) Cosmos DB SDK only d) Data Migration Tool
Understanding RU Consumption in Data Modeling
What does RU/s in Cosmos DB measure? a) Storage usage per second b) Query complexity per second c) Throughput and performance d) Total data operations
Which operation typically consumes the highest RU/s? a) Point read b) Write operation c) Query with multiple filters d) Deleting a document
How can you reduce RU consumption for a query? a) Use a smaller partition key b) Disable indexing for unnecessary fields c) Increase the number of physical partitions d) Store data in multiple containers
What is a key factor that affects RU/s consumption? a) Number of indexes b) Network latency c) Physical partition count d) Data model complexity
What is the minimum RU/s that can be provisioned for a container? a) 100 RU/s b) 400 RU/s c) 1,000 RU/s d) 10,000 RU/s
Scenario-Based Questions
A query is frequently throttled due to high RU consumption. What should you do? a) Reduce the indexing policy complexity b) Increase provisioned RU/s c) Change the container’s consistency level d) Split the query into smaller parts
Data in your container is highly skewed across partitions. What might be the issue? a) Partition key has low cardinality b) Data model is normalized c) Too many indexes are defined d) RU/s are misconfigured
Your application requires global distribution with minimal latency. What should you configure? a) Multi-master writes b) Composite indexes c) Cross-region failover d) Manual indexing
A write operation is slower than expected. What could be the cause? a) High RU/s provisioned b) Hot partition due to poor key selection c) High query parallelism d) Reduced consistency level
How do you analyze RU consumption for specific queries? a) Use Azure Monitor logs b) Query Metrics in the Azure Portal c) Data Migration Tool d) Application Insights
Answers
QNo
Answer
1
b) Data denormalization and entity grouping
2
c) Partition key selection
3
a) Reduced query complexity
4
b) By embedding or referencing data
5
a) Using a single partition key for all entities
6
a) Query cost and throughput requirements
7
a) High cardinality and evenly distributed values
8
c) 100 GB
9
c) Using GUIDs as partition keys for all workloads
10
a) The partition is split automatically
11
b) Partition key values
12
b) Manage logical partition distribution
13
a) They ensure data is evenly distributed across physical partitions