Bird
0
0

You have a high-traffic DynamoDB table with a partition key 'DeviceId'. To prevent hot partitions, you decide to add a suffix. Which suffix strategy is best?

hard🚀 Application Q8 of 15
DynamoDB - Access Patterns and Query Optimization
You have a high-traffic DynamoDB table with a partition key 'DeviceId'. To prevent hot partitions, you decide to add a suffix. Which suffix strategy is best?
AAdd the same timestamp suffix to all 'DeviceId's
BAdd a fixed string suffix like '#001' to all 'DeviceId's
CAdd a hash of the current minute to 'DeviceId'
DAdd a sequential number suffix starting at 1
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate suffix randomness

    A hash of the current minute adds variability and spreads writes across partitions.
  2. Step 2: Reject fixed or sequential suffixes

    Fixed or sequential suffixes cause clustering and hot partitions.
  3. Final Answer:

    Add a hash of the current minute to 'DeviceId' -> Option C
  4. Quick Check:

    Randomized suffixes prevent hot partitions [OK]
Quick Trick: Use time-based hash suffix for even distribution [OK]
Common Mistakes:
MISTAKES
  • Using fixed or sequential suffixes
  • Adding identical suffix to all keys
  • Ignoring suffix randomness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes