Bird
0
0

What is the main difference between a Local Secondary Index (LSI) and a Global Secondary Index (GSI) in DynamoDB?

easy📝 Conceptual Q11 of 15
AWS - DynamoDB
What is the main difference between a Local Secondary Index (LSI) and a Global Secondary Index (GSI) in DynamoDB?
ALSI can have a different partition key, but GSI must use the main table's partition key.
BLSI uses the same partition key as the main table, but GSI can use a different partition key.
CLSI and GSI both require the same partition and sort keys as the main table.
DLSI is only for read operations, while GSI is only for write operations.
Step-by-Step Solution
Solution:
  1. Step 1: Understand LSI key structure

    LSI shares the same partition key as the main table but allows a different sort key.
  2. Step 2: Understand GSI key structure

    GSI can have a completely different partition key and sort key from the main table.
  3. Final Answer:

    LSI uses the same partition key as the main table, but GSI can use a different partition key. -> Option B
  4. Quick Check:

    LSI shares partition key, GSI can differ [OK]
Quick Trick: LSI shares partition key; GSI can change both keys [OK]
Common Mistakes:
  • Thinking LSI can have a different partition key
  • Assuming GSI must use main table keys
  • Confusing read/write capabilities of indexes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes