Challenge - 5 Problems
Event-Driven DynamoDB Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Querying DynamoDB Stream Events for Specific Event Types
You have a DynamoDB table with streams enabled. The stream records include events of types INSERT, MODIFY, and REMOVE. Which query expression will correctly filter and return only the INSERT events from the stream records?
DynamoDB
SELECT * FROM StreamRecords WHERE eventName = 'INSERT';Attempts:
2 left
💡 Hint
Check the exact attribute name used for event type in DynamoDB streams.
✗ Incorrect
DynamoDB stream records use the attribute 'eventName' to indicate the type of event, such as INSERT, MODIFY, or REMOVE. Using 'eventName = 'INSERT'' correctly filters for insert events.
🧠 Conceptual
intermediate2:00remaining
Understanding Event Sourcing with DynamoDB
In an event-driven architecture using DynamoDB, what is the main advantage of using event sourcing to store changes as events rather than storing only the current state?
Attempts:
2 left
💡 Hint
Think about how event sourcing helps with state recovery and auditing.
✗ Incorrect
Event sourcing stores all changes as events, enabling the system to rebuild the current state by replaying these events. This provides a full history and audit trail.
📝 Syntax
advanced2:00remaining
Correct Syntax for DynamoDB Stream Event Processing in Lambda
Which of the following AWS Lambda event handler code snippets correctly accesses the new image of a DynamoDB stream record for an INSERT event?
DynamoDB
exports.handler = async (event) => { for (const record of event.Records) { if (record.eventName === 'INSERT') { const newImage = record.dynamodb.NewImage; // process newImage } } };
Attempts:
2 left
💡 Hint
Check the exact casing and property names in the DynamoDB stream record object.
✗ Incorrect
The correct property to access the new image is 'NewImage' under 'dynamodb' in the stream record. It is case-sensitive.
❓ optimization
advanced2:00remaining
Optimizing Event Processing with DynamoDB Streams and Lambda
You want to optimize your Lambda function triggered by DynamoDB streams to process events efficiently. Which approach will best reduce cold start latency and improve throughput?
Attempts:
2 left
💡 Hint
Think about how batch size affects invocation frequency and processing speed.
✗ Incorrect
Increasing batch size allows Lambda to process multiple records in one invocation, reducing overhead and cold starts, thus improving throughput.
🔧 Debug
expert2:00remaining
Debugging Missing Events in DynamoDB Stream Processing
Your Lambda function processing DynamoDB stream events sometimes misses INSERT events. Which of the following is the most likely cause?
Attempts:
2 left
💡 Hint
Consider the stream view type configuration and what data it provides.
✗ Incorrect
If the stream is set to KEYS_ONLY, only keys are included in stream records, so the Lambda cannot access the full new image of inserted items, causing missing event data.