Challenge - 5 Problems
DynamoDB Streams Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What does DynamoDB Streams capture?
DynamoDB Streams records changes in a DynamoDB table. What kind of changes does it capture?
Attempts:
2 left
💡 Hint
Think about what you want to track if you want a full history of changes.
✗ Incorrect
DynamoDB Streams captures all item-level changes: inserts, updates, and deletes, allowing applications to react to any modification.
❓ query_result
intermediate1:30remaining
What is the output of this DynamoDB Stream record?
Given a DynamoDB Stream record for an update event, what does the 'NewImage' attribute contain?
DynamoDB
StreamRecord: {
"eventName": "MODIFY",
"dynamodb": {
"NewImage": {"Id": {"S": "101"}, "Status": {"S": "Shipped"}},
"OldImage": {"Id": {"S": "101"}, "Status": {"S": "Pending"}}
}
}Attempts:
2 left
💡 Hint
NewImage means the new state of the item after the change.
✗ Incorrect
The 'NewImage' attribute contains the full item data after the update event.
📝 Syntax
advanced2:00remaining
Which option correctly enables DynamoDB Streams on a table with NEW_AND_OLD_IMAGES?
You want to enable DynamoDB Streams on a table to capture both new and old images of items. Which AWS CLI command is correct?
DynamoDB
aws dynamodb update-table --table-name Orders --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
Attempts:
2 left
💡 Hint
Check the correct syntax for comma-separated key-value pairs in AWS CLI.
✗ Incorrect
The correct syntax uses comma-separated key-value pairs without spaces or colons.
❓ optimization
advanced1:30remaining
How to minimize costs when using DynamoDB Streams?
You want to reduce costs while using DynamoDB Streams for a high-traffic table. Which approach helps minimize costs?
Attempts:
2 left
💡 Hint
Less data in streams means less processing and storage cost.
✗ Incorrect
Using KEYS_ONLY reduces the amount of data captured in streams, lowering costs.
🔧 Debug
expert2:30remaining
Why does this Lambda function triggered by DynamoDB Streams fail with a TypeError?
A Lambda function processes DynamoDB Stream events. It tries to access event.Records[0].dynamodb.NewImage.Name.S but fails with TypeError: Cannot read property 'S' of undefined. What is the likely cause?
DynamoDB
exports.handler = async (event) => { const name = event.Records[0].dynamodb.NewImage.Name.S; console.log(name); };
Attempts:
2 left
💡 Hint
Check if the attribute you access is always present in the stream record.
✗ Incorrect
If the 'Name' attribute is missing in NewImage, accessing .S causes a TypeError.