Bird
0
0

Why does single-table design in DynamoDB often use composite keys with prefixes like 'USER#' or 'ORDER#'?

hard🧠 Conceptual Q10 of 15
DynamoDB - Access Patterns and Query Optimization
Why does single-table design in DynamoDB often use composite keys with prefixes like 'USER#' or 'ORDER#'?
ATo store binary data in keys
BTo increase table size and complexity
CTo make partition keys optional
DTo avoid key collisions and enable efficient queries across entity types
Step-by-Step Solution
Solution:
  1. Step 1: Understand key prefix purpose

    Prefixes distinguish entity types in the same table, preventing key collisions.
  2. Step 2: Evaluate options

    To avoid key collisions and enable efficient queries across entity types correctly explains the reason. To increase table size and complexity is false; prefixes simplify queries. To make partition keys optional is incorrect; partition keys are required. To store binary data in keys is unrelated.
  3. Final Answer:

    To avoid key collisions and enable efficient queries across entity types -> Option D
  4. Quick Check:

    Prefixes prevent collisions = A [OK]
Quick Trick: Prefixes in keys separate entity types clearly [OK]
Common Mistakes:
MISTAKES
  • Thinking prefixes increase complexity negatively
  • Believing partition keys can be optional
  • Misunderstanding key data types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes