Bird
0
0

A table uses a composite partition key with 'Region' and 'UserId'. Hot partitions occur in one region. How can you reduce hot partitions?

hard🚀 Application Q9 of 15
DynamoDB - Access Patterns and Query Optimization
A table uses a composite partition key with 'Region' and 'UserId'. Hot partitions occur in one region. How can you reduce hot partitions?
AAdd a random suffix to 'UserId' within the hot region
BRemove 'Region' from the partition key
CUse only 'Region' as partition key
DIncrease write capacity units for the table
Step-by-Step Solution
Solution:
  1. Step 1: Identify hot region cause

    Hot partitions in one region mean many writes target same 'Region' and 'UserId' keys.
  2. Step 2: Apply suffix to spread load

    Adding random suffix to 'UserId' in that region spreads writes across partitions.
  3. Final Answer:

    Add a random suffix to 'UserId' within the hot region -> Option A
  4. Quick Check:

    Random suffix in composite key reduces hot partitions [OK]
Quick Trick: Randomize keys in hot regions to balance load [OK]
Common Mistakes:
MISTAKES
  • Removing region increases hot partitions
  • Increasing capacity doesn't fix key distribution
  • Using only region causes more hotspots

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes