In AWS DynamoDB, what is the primary difference between a partition key and a sort key in a table?
Think about how DynamoDB organizes data to allow efficient queries.
The partition key determines the partition where data is stored. The sort key allows multiple items to share the same partition key but be distinguished by the sort key.
Which of the following JSON representations correctly defines a DynamoDB item with a string attribute 'Name' and a number attribute 'Age'?
DynamoDB expects attribute values to be typed explicitly in JSON format.
DynamoDB JSON format requires attribute values to be objects with a type key such as 'S' for string and 'N' for number, with the value as a string.
You need to design a DynamoDB table to handle very high write throughput evenly distributed across partitions. Which table key design helps avoid hot partitions?
Think about how DynamoDB partitions data and distributes load.
A high-cardinality partition key spreads writes across many partitions, preventing hot spots. A composite key with a sort key allows efficient queries and balanced writes.
How can you restrict a userβs access to only certain attributes of items in a DynamoDB table?
Consider AWS IAM fine-grained access control features.
IAM policies can use condition keys like dynamodb:Attributes to restrict access to specific attributes within items.
If you perform a strongly consistent read on a DynamoDB table immediately after writing an item, what is the expected behavior?
Think about the difference between eventually consistent and strongly consistent reads.
Strongly consistent reads always return the most recent data after a successful write, ensuring no stale data is returned.