You use the AWS DynamoDB PutItem operation to add an item with a primary key that already exists in the table. What happens to the existing item?
Think about how PutItem treats items with the same primary key.
PutItem replaces the entire existing item if the primary key matches. It does not merge or append duplicates.
When you perform a GetItem operation in DynamoDB, which option ensures you get the most up-to-date data?
Consider how DynamoDB handles read consistency.
Setting ConsistentRead to true in GetItem returns strongly consistent data, ensuring the latest updates are read.
You want to retrieve all items from a DynamoDB table where the partition key is 'User123' and the attribute 'Status' equals 'Active'. Which Query operation parameters correctly achieve this?
TableName: 'Users' KeyConditionExpression: 'UserId = :uid' FilterExpression: 'Status = :status' ExpressionAttributeValues: { ':uid': {S: 'User123'}, ':status': {S: 'Active'} }
Remember that KeyConditionExpression must include the partition key.
KeyConditionExpression filters by partition key and optionally sort key. FilterExpression filters non-key attributes after the query.
You need to retrieve multiple items from a DynamoDB table by their primary keys in a single request. Which operation is the most efficient and appropriate?
Consider which operation supports multiple keys in one call.
BatchGetItem allows retrieving multiple items by primary keys in a single request efficiently.
You want to restrict an IAM user so they can only perform PutItem operations on a DynamoDB table but only for items where the attribute 'Department' equals 'Sales'. Which IAM policy condition correctly enforces this?
Think about how to restrict based on an attribute value in IAM conditions.
The condition "StringEquals" on "dynamodb:Attributes/Department" restricts PutItem to items where Department equals 'Sales'.