DynamoDB Streams is a feature that captures a time-ordered sequence of item-level changes in a DynamoDB table. It lets you track and react to data changes like inserts, updates, and deletes.
Click to reveal answer
beginner
What types of data changes does DynamoDB Streams capture?
It captures inserts (new items), updates (changes to existing items), and deletes (removal of items) in the table.
Click to reveal answer
intermediate
How can DynamoDB Streams be used in real life?
You can use Streams to trigger actions like updating a search index, sending notifications, or replicating data to another system whenever your table changes.
Click to reveal answer
intermediate
What is a shard in DynamoDB Streams?
A shard is a container for stream records. It holds a sequence of data changes and allows applications to read these changes in order.
Click to reveal answer
beginner
How long are records kept in DynamoDB Streams?
Stream records are kept for 24 hours from the time they are generated. After that, they expire and are no longer accessible.
Click to reveal answer
What does DynamoDB Streams capture?
AItem-level changes like inserts, updates, and deletes
BOnly table schema changes
CUser login events
DBackup snapshots
✗ Incorrect
DynamoDB Streams captures item-level changes such as inserts, updates, and deletes.
How long are DynamoDB Stream records available for reading?
A7 days
B30 days
C24 hours
DIndefinitely
✗ Incorrect
Stream records are kept for 24 hours after creation.
Which of the following is NOT a use case for DynamoDB Streams?
AStoring large binary files
BReal-time data replication
CTriggering a Lambda function on data change
DUpdating a search index
✗ Incorrect
DynamoDB Streams is not used for storing files; it tracks data changes.
What is a shard in DynamoDB Streams?
AA backup copy of the table
BA container for a sequence of stream records
CA type of index
DA user permission level
✗ Incorrect
A shard holds a sequence of stream records for reading changes.
Can DynamoDB Streams capture changes to table schema?
AOnly for global secondary indexes
BYes, it captures all schema changes
COnly when enabled explicitly
DNo, it only captures item-level data changes
✗ Incorrect
Streams capture only item-level changes, not schema changes.
Explain what DynamoDB Streams is and why it is useful.
Think about how you might want to react when your data changes.
You got /4 concepts.
Describe the lifecycle of a record in DynamoDB Streams.
Consider how long you can access the change after it happens.
You got /4 concepts.
Practice
(1/5)
1. What is the primary purpose of DynamoDB Streams?
easy
A. To back up the entire DynamoDB table automatically every hour
B. To capture and record changes made to items in a DynamoDB table in real time
C. To increase the read capacity of a DynamoDB table
D. To encrypt data stored in DynamoDB tables
Solution
Step 1: Understand DynamoDB Streams functionality
DynamoDB Streams capture data changes such as inserts, updates, and deletes on a table.
Step 2: Compare options with Streams purpose
Only To capture and record changes made to items in a DynamoDB table in real time describes capturing changes in real time, which is the core function of Streams.
Final Answer:
To capture and record changes made to items in a DynamoDB table in real time -> Option B
Quick Check:
DynamoDB Streams = capture changes [OK]
Hint: Streams track table changes live, not backups or capacity [OK]
Common Mistakes:
Confusing Streams with backups
Thinking Streams increase capacity
Assuming Streams encrypt data
2. Which of the following is the correct way to enable DynamoDB Streams on a table?
easy
A. Enable Auto Scaling on the table
B. Add a Global Secondary Index with StreamEnabled = true
C. Create a Lambda function and attach it to the table without enabling Streams
D. Set the StreamSpecification with StreamEnabled = true and choose a StreamViewType
Solution
Step 1: Recall how to enable Streams
Streams are enabled by setting StreamSpecification with StreamEnabled true and selecting a StreamViewType.
Step 2: Evaluate options
Set the StreamSpecification with StreamEnabled = true and choose a StreamViewType correctly describes enabling Streams. Other options relate to indexes, Lambda, or scaling, which do not enable Streams.
Final Answer:
Set the StreamSpecification with StreamEnabled = true and choose a StreamViewType -> Option D
This view type captures both the item image before and after the change.
Step 2: Match options to the view type
Both the new and old images of the item correctly states both new and old images are included. Other options only mention one or keys.
Final Answer:
Both the new and old images of the item -> Option C
Quick Check:
NEW_AND_OLD_IMAGES = new + old images [OK]
Hint: NEW_AND_OLD_IMAGES means both before and after data included [OK]
Common Mistakes:
Thinking only new or only old image is included
Confusing keys-only view with full images
Ignoring the StreamViewType setting
4. You have enabled DynamoDB Streams but your Lambda function is not receiving any events despite recent writes to the table. What is a possible reason?
medium
A. The Lambda function is not properly configured as an event source for the stream
B. The table has no write activity, so no stream records are generated
C. All of the above
D. The StreamViewType was set to KEYS_ONLY, but your Lambda expects full images
Solution
Step 1: Analyze the scenario
Streams enabled with recent writes means records are generated, so issue is likely with Lambda setup to consume stream events.
Step 2: Evaluate options
The Lambda not being configured as an event source for the stream explains no events. All of the above doesn't apply since writes occurred. No write activity contradicted by scenario. StreamViewType affects record content, not event delivery to Lambda.
Final Answer:
The Lambda function is not properly configured as an event source for the stream -> Option A
Quick Check:
No events despite writes = Lambda event source not mapped [OK]
Hint: Lambda must be mapped as event source to DynamoDB Stream [OK]
Common Mistakes:
Ignoring that no writes means no stream records
Forgetting to attach Lambda as event source
Assuming KEYS_ONLY always sends full data
5. You want to build a system that reacts only when an item's attribute status changes in your DynamoDB table. Which StreamViewType should you choose to efficiently detect this change?
hard
A. NEW_AND_OLD_IMAGES
B. OLD_IMAGE
C. NEW_IMAGE
D. KEYS_ONLY
Solution
Step 1: Identify data needed to detect attribute changes
To know if 'status' changed, you need both old and new values to compare.
Step 2: Match StreamViewType to requirement
Only NEW_AND_OLD_IMAGES provides both before and after images for comparison.
Final Answer:
NEW_AND_OLD_IMAGES -> Option A
Quick Check:
Detect attribute change = need old + new images [OK]
Hint: Compare old and new images to detect attribute changes [OK]
Common Mistakes:
Choosing only NEW_IMAGE or OLD_IMAGE which lacks comparison data
Assuming KEYS_ONLY includes attribute data
Not realizing both images are needed to detect changes
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.