Recall & Review
beginner
What is a Global Secondary Index (GSI) in DynamoDB?
A GSI is an index with a partition key and optional sort key that can be different from the base table's keys. It allows querying data efficiently using alternate keys.
Click to reveal answer
beginner
Why is key selection important when creating a GSI?
Choosing the right keys ensures efficient queries, balanced data distribution, and avoids hot partitions that can slow down performance.
Click to reveal answer
intermediate
What should you consider about data distribution when selecting a GSI partition key?
Pick a key with many distinct values that spread requests evenly across partitions to prevent bottlenecks.
Click to reveal answer
intermediate
How does the choice of a GSI sort key affect query flexibility?
A sort key lets you filter and sort data within a partition, enabling more precise and efficient queries.
Click to reveal answer
advanced
What is a common mistake when selecting GSI keys?
Choosing keys with low cardinality or skewed data can cause hot partitions and reduce query performance.
Click to reveal answer
What is the main purpose of a GSI in DynamoDB?
✗ Incorrect
A GSI lets you query data efficiently using alternate keys different from the table's primary key.
Which characteristic is best for a GSI partition key?
✗ Incorrect
Many distinct values with even access help distribute load evenly and avoid hot partitions.
How does a GSI sort key improve queries?
✗ Incorrect
A sort key lets you filter and sort data within the same partition key, making queries more flexible.
What happens if a GSI partition key has low cardinality?
✗ Incorrect
Low cardinality means few distinct values, which can cause uneven load and slow down queries.
Which is NOT a good practice when selecting GSI keys?
✗ Incorrect
Keys with skewed data cause hot partitions and reduce performance, so they should be avoided.
Explain how to choose a good partition key for a GSI in DynamoDB.
Think about how to spread workload evenly and support your queries.
You got /4 concepts.
Describe the role of a sort key in a GSI and how it affects querying.
Consider how you can narrow down results inside one partition.
You got /4 concepts.