0
0
DynamoDBquery~20 mins

Transaction vs batch comparison in DynamoDB - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB Transaction & Batch Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference between DynamoDB transactions and batch operations
Which statement correctly describes a key difference between DynamoDB transactions and batch operations?
ATransactions guarantee all operations succeed or fail together, while batch operations do not provide atomicity.
BBatch operations guarantee atomicity across all items, but transactions do not.
CTransactions can only read data, while batch operations can only write data.
DBatch operations automatically retry failed requests, but transactions never retry.
Attempts:
2 left
💡 Hint
Think about whether all operations in the group must succeed or can partially succeed.
query_result
intermediate
2:00remaining
Result of a batch write with partial failures
You perform a BatchWriteItem request with 5 put operations. Two items exceed the provisioned throughput and fail. What is the result returned by DynamoDB?
ADynamoDB retries automatically until all 5 items succeed before returning.
BThe entire batch write fails and no items are written.
CThe response includes UnprocessedItems for the 2 failed items; the other 3 succeed.
DThe response returns an error and no items are written.
Attempts:
2 left
💡 Hint
Consider how DynamoDB handles throughput limits in batch operations.
📝 Syntax
advanced
2:00remaining
Correct syntax for a DynamoDB transaction write request
Which JSON snippet correctly represents a TransactWriteItems request with two Put operations in DynamoDB?
A{ "BatchWriteItems": [ { "PutRequest": { "TableName": "Users", "Item": { "UserId": { "S": "123" }, "Name": { "S": "Alice" } } } }, { "PutRequest": { "TableName": "Orders", "Item": { "OrderId": { "S": "abc" }, "Amount": { "N": "100" } } } } ] }
B{ "TransactItems": [ { "PutRequest": { "TableName": "Users", "Item": { "UserId": { "S": "123" }, "Name": { "S": "Alice" } } } }, { "PutRequest": { "TableName": "Orders", "Item": { "OrderId": { "S": "abc" }, "Amount": { "N": "100" } } } } ] }
C{ "TransactWriteItems": { "Put": [ { "TableName": "Users", "Item": { "UserId": { "S": "123" }, "Name": { "S": "Alice" } } }, { "TableName": "Orders", "Item": { "OrderId": { "S": "abc" }, "Amount": { "N": "100" } } } ] } }
D{ "TransactItems": [ { "Put": { "TableName": "Users", "Item": { "UserId": { "S": "123" }, "Name": { "S": "Alice" } } } }, { "Put": { "TableName": "Orders", "Item": { "OrderId": { "S": "abc" }, "Amount": { "N": "100" } } } } ] }
Attempts:
2 left
💡 Hint
Look for the correct key names and structure for TransactWriteItems.
optimization
advanced
2:00remaining
Optimizing throughput when using batch writes
You want to write 1000 items to DynamoDB efficiently. Which approach optimizes throughput and minimizes throttling?
ASplit the items into batches of 25 and use BatchWriteItem with exponential backoff retries for unprocessed items.
BSend all 1000 items in a single BatchWriteItem request to minimize network calls.
CWrite items one by one with PutItem requests to avoid batch size limits.
DUse TransactWriteItems for all 1000 items to ensure atomicity and speed.
Attempts:
2 left
💡 Hint
Consider DynamoDB limits on batch sizes and how to handle throttling.
🔧 Debug
expert
3:00remaining
Identifying the cause of a TransactionCanceledException
A TransactWriteItems request fails with TransactionCanceledException and cancellation reasons indicating a ConditionalCheckFailed. What is the most likely cause?
AThe table does not exist or is misspelled in the request.
BOne or more condition expressions in the transaction failed, causing the entire transaction to abort.
CThe request used BatchWriteItem syntax instead of TransactWriteItems.
DThe transaction exceeded the maximum allowed size of 25 items.
Attempts:
2 left
💡 Hint
Think about what ConditionalCheckFailed means in a transaction context.