0
0
AWScloud~5 mins

Secondary indexes (GSI, LSI) in AWS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Global Secondary Index (GSI) in DynamoDB?
A Global Secondary Index (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 across all table data.
Click to reveal answer
beginner
What is a Local Secondary Index (LSI) in DynamoDB?
A Local Secondary Index (LSI) is an index that uses the same partition key as the base table but a different sort key. It allows querying data within the same partition using alternate sort keys.
Click to reveal answer
intermediate
Can you add a Global Secondary Index (GSI) after creating a DynamoDB table?
Yes, you can add a GSI to an existing DynamoDB table at any time without downtime.
Click to reveal answer
intermediate
Can you add a Local Secondary Index (LSI) after creating a DynamoDB table?
No, LSIs must be defined when the table is created and cannot be added later.
Click to reveal answer
intermediate
What is a key difference in storage between GSI and LSI?
LSIs share the same partition key and storage as the base table, while GSIs have their own storage and can have different partition keys.
Click to reveal answer
Which index type in DynamoDB can have a different partition key than the base table?
ALocal Secondary Index (LSI)
BGlobal Secondary Index (GSI)
CPrimary Key
DSort Key
When can you add a Local Secondary Index (LSI) to a DynamoDB table?
AOnly during table update
BAnytime after table creation
COnly during table creation
DLSIs cannot be added at all
Which index type shares the same partition key as the base table?
AGlobal Secondary Index (GSI)
BBoth GSI and LSI
CNeither GSI nor LSI
DLocal Secondary Index (LSI)
What happens to storage when you create a Global Secondary Index (GSI)?
AGSI uses separate storage from the base table
BGSI shares storage with the base table
CGSI does not use any storage
DGSI storage is temporary
Which index type can be added to a DynamoDB table without downtime?
AGlobal Secondary Index (GSI)
BLocal Secondary Index (LSI)
CNeither
DBoth
Explain the main differences between Global Secondary Index (GSI) and Local Secondary Index (LSI) in DynamoDB.
Think about keys, timing of creation, and storage.
You got /5 concepts.
    Describe when and why you would use a Global Secondary Index (GSI) versus a Local Secondary Index (LSI).
    Consider query needs and index flexibility.
    You got /4 concepts.