0
0
DynamoDBquery~5 mins

GSI key selection strategy in DynamoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ATo store backup copies of data
BTo increase write throughput only
CTo allow queries on attributes other than the primary key
DTo encrypt data automatically
Which characteristic is best for a GSI partition key?
AFew distinct values with uneven access
BMany distinct values with even access
CA constant value for all items
DA large text attribute
How does a GSI sort key improve queries?
AIt allows filtering and sorting within a partition
BIt encrypts the data
CIt increases storage capacity
DIt speeds up writes
What happens if a GSI partition key has low cardinality?
AHot partitions may form, causing slow queries
BData is evenly distributed
CThe index automatically scales
DQueries become faster
Which is NOT a good practice when selecting GSI keys?
AChoosing keys with many distinct values
BSelecting keys that match query patterns
CIncluding a sort key for filtering
DUsing keys with skewed data distribution
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.