Are you preparing to master AWS DynamoDB data modeling? This comprehensive guide to AWS DynamoDB MCQ questions and answers covers key concepts such as scalable data models, indexing (LSI and GSI), handling relationships, and single-table design patterns. These questions will help you ace certifications and interviews with ease!
Chapter 3: Advanced Data Modeling – MCQs
Designing Scalable and Efficient Data Models
What is the key principle for designing scalable data models in DynamoDB? a) Minimizing query volume b) Distributing data evenly across partitions c) Using multiple databases d) Relying on complex SQL queries
Which of the following helps reduce partition skew in DynamoDB? a) Adding more read capacity units b) Using composite keys c) Increasing table size d) Storing data in S3
DynamoDB uses which partitioning strategy to distribute data? a) Vertical partitioning b) Random partitioning c) Hash-based partitioning d) Range-based partitioning
When designing a data model for high-traffic applications, what is essential? a) Use a single partition key for all queries b) Use queries instead of scans c) Increase read capacity units only d) Avoid using indexes
What is a best practice for DynamoDB primary key selection? a) Use static keys for predictable queries b) Select a key with low cardinality c) Use keys that evenly distribute data d) Always use numeric keys
Indexing in DynamoDB: Local Secondary Indexes (LSI)
What is a Local Secondary Index (LSI) in DynamoDB? a) An index with a unique partition key b) An index sharing the partition key but having a different sort key c) A global index shared across tables d) An index used for streaming data
What is the maximum number of LSIs that can be created per table? a) 5 b) 10 c) 15 d) 20
Which of the following operations can benefit from LSIs? a) Batch writes b) Filtering items by sort key c) Table replication d) Data backup
Which condition applies to LSIs? a) LSIs can be added anytime b) LSIs must be defined during table creation c) LSIs share a separate provisioned throughput d) LSIs can have their own partition key
In what scenario is an LSI most useful? a) When querying based on non-key attributes b) When using the same partition key but different sort keys c) When performing updates on a table d) When reading data from multiple regions
Indexing in DynamoDB: Global Secondary Indexes (GSI)
What is a Global Secondary Index (GSI)? a) An index that shares the table’s partition key b) An index with a different partition key and sort key c) An index that automatically replicates across regions d) A temporary index for ad hoc queries
What is the maximum number of GSIs allowed per table? a) 5 b) 10 c) 20 d) Unlimited
Which operation is supported directly on a GSI? a) Data updates b) Write throttling c) Query operations d) Table replication
Which statement is true about GSI throughput? a) GSIs share the table’s throughput capacity b) GSIs require their own provisioned throughput c) GSIs are not affected by throughput limits d) GSIs always use on-demand capacity
What happens when a GSI exceeds its provisioned capacity? a) The table is throttled b) The GSI stops working c) Queries to the GSI are throttled d) Data in the GSI becomes inconsistent
Handling Relationships in DynamoDB
What is the recommended approach for modeling one-to-many relationships in DynamoDB? a) Use a single table with separate partition keys b) Use multiple tables for parent and child entities c) Embed child entities in the parent item d) Use GSIs with separate throughput capacity
Which approach helps in managing many-to-many relationships in DynamoDB? a) Use junction tables b) Use LSIs for both entities c) Rely only on partition keys d) Avoid using sort keys
How can a parent-child relationship be modeled using composite keys? a) By using a shared partition key and different sort keys b) By using distinct tables for each entity c) By embedding child entities in the parent record d) By defining multiple GSIs
Which pattern is best for representing hierarchical relationships in DynamoDB? a) Graph-based data structure b) Tree structure using composite keys c) Flat structure with multiple tables d) Storing data in S3
In which scenario should separate tables be preferred over composite keys? a) When relationships are static b) When different entities have independent growth rates c) When data volume is low d) When queries are infrequent
Patterns for Single-Table Design
What is the primary advantage of single-table design in DynamoDB? a) Improved write performance b) Faster query results for complex data models c) Reducing the need for multiple indexes d) Automatic schema enforcement
What key strategy is used for designing single-table structures? a) Normalizing data b) Using composite keys to store different entity types c) Relying on fixed attribute names d) Separating large datasets into multiple tables
Which of the following is a challenge of single-table design? a) Scalability issues b) Complex query construction c) Limited capacity of partition keys d) Increased latency for batch operations
What is a common use case for single-table design in DynamoDB? a) User profiles and their related orders b) Storing large media files c) Managing table indexes d) Streaming data analysis
How can single-table design reduce DynamoDB costs? a) By decreasing read and write capacity units b) By eliminating the need for GSIs c) By storing data in multiple regions d) By reducing the number of tables
Which tool can be used to simulate and optimize single-table designs in DynamoDB? a) AWS Data Modeling Tool b) NoSQL Workbench c) DynamoDB Index Builder d) AWS Schema Designer
What is a key benefit of partition key design in single-table patterns? a) High cardinality for better data distribution b) Ability to directly query nested attributes c) Replicating data across regions d) Optimizing table backup operations
How does single-table design affect query operations in DynamoDB? a) Queries become slower b) Queries become more efficient c) Queries require separate indexes d) Queries depend on table partition size
When should single-table design NOT be used in DynamoDB? a) For highly relational data models b) For applications with predictable query patterns c) For handling flat, unrelated datasets d) For storing hierarchical relationships
Which of the following is a disadvantage of single-table design? a) Increased schema flexibility b) Complexity in data modeling c) Reduced partition throughput d) Inefficient storage utilization
Answer Key
Qno
Answer (Option with the text)
1
b) Distributing data evenly across partitions
2
b) Using composite keys
3
c) Hash-based partitioning
4
b) Use queries instead of scans
5
c) Use keys that evenly distribute data
6
b) An index sharing the partition key but having a different sort key
7
a) 5
8
b) Filtering items by sort key
9
b) LSIs must be defined during table creation
10
b) When using the same partition key but different sort keys
11
b) An index with a different partition key and sort key
12
b) 10
13
c) Query operations
14
b) GSIs require their own provisioned throughput
15
c) Queries to the GSI are throttled
16
c) Embed child entities in the parent item
17
a) Use junction tables
18
a) By using a shared partition key and different sort keys
19
b) Tree structure using composite keys
20
b) When different entities have independent growth rates
21
b) Faster query results for complex data models
22
b) Using composite keys to store different entity types