A. Writes are distributed across 5 partitions reducing hot spots
B. All writes go to the same partition causing throttling
C. Writes fail due to invalid partition key format
D. Data is only readable by shard_id 0
Solution
Step 1: Analyze shard ID usage
The shard_id is a random number from 0 to 4, appended to the partition key.
Step 2: Understand partition key effect
This creates 5 different partition keys for the same user, spreading writes across 5 partitions.
Final Answer:
Writes are distributed across 5 partitions reducing hot spots -> Option A
Quick Check:
Random shard ID 0-4 = 5 partitions [OK]
Hint: Random shard ID 0-4 means 5 partitions [OK]
Common Mistakes:
Assuming all writes go to one partition
Thinking partition key format is invalid
Believing data is restricted by shard ID
4. You implemented write sharding by appending shard IDs to partition keys, but you notice some writes still cause throttling. What is the likely cause?
medium
A. Shard ID range is too small causing uneven distribution
B. You forgot to add shard ID to the sort key
C. You used a random shard ID but did not update the partition key
D. DynamoDB does not support write sharding
Solution
Step 1: Check shard ID range
If the shard ID range is too small, writes cluster on few partitions causing throttling.
Step 2: Verify correct key usage
Shard ID must be part of the partition key, not sort key, and must cover enough range.
Final Answer:
Shard ID range is too small causing uneven distribution -> Option A
Quick Check:
Small shard range = hot partitions [OK]
Hint: Use enough shard IDs to spread writes evenly [OK]
Common Mistakes:
Adding shard ID to sort key instead of partition key
Not updating partition key with shard ID
Believing DynamoDB disallows sharding
5. You want to design a write sharding strategy for a DynamoDB table with very high write traffic on user data. Which approach best balances write load and allows efficient reads?
hard
A. Write all data to a single partition key and batch writes
B. Use user ID as partition key without sharding; rely on DynamoDB auto-scaling
C. Add shard ID to sort key and keep partition key as user ID
D. Add a random shard ID (0-9) to the partition key and store user data in each shard; aggregate reads by querying all shards
Solution
Step 1: Evaluate write sharding options
Adding a random shard ID (0-9) to partition key spreads writes across 10 partitions.
Step 2: Consider read strategy
Reads require querying all shards and aggregating results, which is manageable for balanced load.
Step 3: Compare other options
Using no sharding risks throttling; shard ID in sort key does not distribute writes; single partition causes hot spots.
Final Answer:
Add a random shard ID (0-9) to the partition key and store user data in each shard; aggregate reads by querying all shards -> Option D
Quick Check:
Shard ID in partition key + aggregate reads = balanced writes [OK]
Hint: Shard in partition key, aggregate reads from all shards [OK]
Common Mistakes:
Not sharding partition key causing hot partitions
Adding shard ID to sort key only
Ignoring read complexity after sharding
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.