AWS Lambda is a service that runs your code in response to events and automatically manages the computing resources for you.
Click to reveal answer
beginner
What is Amazon DynamoDB?
Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale.
Click to reveal answer
beginner
Why do DynamoDB and Lambda work well together?
Because DynamoDB can trigger Lambda functions automatically when data changes, allowing you to run code in response to database events without managing servers.
Click to reveal answer
intermediate
How does Lambda help with DynamoDB streams?
Lambda reads DynamoDB streams, which capture table activity, and runs your code to process these changes in real-time.
Click to reveal answer
beginner
What is a real-life example of using DynamoDB with Lambda?
When a new order is added to DynamoDB, Lambda can automatically send a confirmation email or update inventory without you writing extra server code.
Click to reveal answer
What triggers a Lambda function when using DynamoDB?
AScheduled daily at midnight
BManual server restart
CChanges in DynamoDB table via streams
DUser login to AWS console
✗ Incorrect
Lambda functions can be triggered automatically by changes in DynamoDB tables through DynamoDB streams.
Which of these best describes DynamoDB?
ARelational database with fixed schema
BNoSQL database with fast, scalable performance
CFile storage service
DVirtual machine service
✗ Incorrect
DynamoDB is a NoSQL database designed for fast and scalable performance.
What is a key benefit of pairing Lambda with DynamoDB?
AYou can run code automatically when data changes
BYou must manage servers manually
CYou need to write complex server setup scripts
DYou get slower response times
✗ Incorrect
Lambda lets you run code automatically in response to DynamoDB data changes without managing servers.
What is a DynamoDB stream?
AA type of database index
BA video streaming service
CA backup of the database
DA log of changes made to a DynamoDB table
✗ Incorrect
DynamoDB streams capture a log of changes made to a table, which Lambda can process.
Which scenario shows how Lambda and DynamoDB work together?
ALambda sends an email when a new item is added to DynamoDB
BLambda stores files in DynamoDB
CDynamoDB runs Lambda code directly
DLambda replaces DynamoDB as a database
✗ Incorrect
Lambda can run code like sending emails automatically when DynamoDB data changes.
Explain why DynamoDB and Lambda are a good pair for building serverless applications.
Think about how events in the database can start code without manual steps.
You got /4 concepts.
Describe a simple use case where Lambda reacts to DynamoDB data changes.
Imagine an online store order confirmation process.
You got /4 concepts.
Practice
(1/5)
1. Why is DynamoDB often paired with AWS Lambda in serverless applications?
easy
A. Because Lambda can automatically run code when DynamoDB data changes
B. Because DynamoDB requires Lambda to store data
C. Because Lambda stores data faster than DynamoDB
D. Because DynamoDB and Lambda are both relational databases
Solution
Step 1: Understand DynamoDB's role
DynamoDB stores data quickly and scales automatically without needing servers.
Step 2: Understand Lambda's role
Lambda runs code automatically in response to events, such as changes in DynamoDB data.
Final Answer:
Because Lambda can automatically run code when DynamoDB data changes -> Option A
Quick Check:
Event-driven code execution = C [OK]
Hint: Remember: Lambda reacts to DynamoDB events automatically [OK]
Common Mistakes:
Thinking DynamoDB needs Lambda to store data
Confusing Lambda as a database
Believing both are relational databases
2. Which of the following is the correct way to configure a Lambda function to trigger on DynamoDB table changes?
easy
A. Directly call Lambda from DynamoDB without any configuration
B. Set up a DynamoDB Stream and attach it as an event source to the Lambda function
C. Use Lambda to poll the DynamoDB table every second
D. Configure DynamoDB to run Lambda code inside its console
Solution
Step 1: Identify how DynamoDB triggers Lambda
DynamoDB Streams capture table changes and can be linked to Lambda as event sources.
Step 2: Evaluate options
Only setting up a DynamoDB Stream and attaching it to Lambda is correct; others are invalid or impossible.
Final Answer:
Set up a DynamoDB Stream and attach it as an event source to the Lambda function -> Option B
Quick Check:
DynamoDB Stream triggers Lambda = A [OK]
Hint: Use DynamoDB Streams to trigger Lambda functions [OK]
Common Mistakes:
Assuming Lambda can be called directly by DynamoDB without streams
Thinking Lambda polls DynamoDB instead of event-driven
Believing DynamoDB runs Lambda code internally
3. Given this Lambda function triggered by a DynamoDB Stream event, what will be the output if a new item with {"id": "123", "status": "new"} is inserted?
exports.handler = async (event) => {
for (const record of event.Records) {
if (record.eventName === 'INSERT') {
console.log('New item:', record.dynamodb.NewImage);
}
}
};
medium
A. Throws an error because NewImage is undefined
B. Does nothing because INSERT events are ignored
C. Logs only the id value as a string
D. Logs the new item data with keys and DynamoDB types
A. The DynamoDB Stream is not enabled or not attached as an event source
B. The Lambda function code is missing a return statement
C. The function should use synchronous invocation instead of async
D. The console.log statement prevents the function from running
Solution
Step 1: Check event source configuration
Lambda triggers on DynamoDB Streams only if the stream is enabled and linked as an event source.
Step 2: Evaluate code and invocation
Code with async and console.log is valid; missing return or sync invocation does not stop triggering.
Final Answer:
The DynamoDB Stream is not enabled or not attached as an event source -> Option A
Quick Check:
Missing stream or event source = D [OK]
Hint: Check if DynamoDB Stream is enabled and linked to Lambda [OK]
Common Mistakes:
Thinking async keyword blocks Lambda triggers
Believing console.log stops execution
Assuming return statement is required for triggers
5. You want to build a serverless app that updates a search index whenever DynamoDB data changes. Which approach best uses DynamoDB and Lambda together?
hard
A. Write search index updates directly inside DynamoDB using Lambda code embedded in the table
B. Have Lambda poll DynamoDB every minute to check for changes and update the index
C. Enable DynamoDB Streams, trigger Lambda on changes, and update the search index inside Lambda
D. Use DynamoDB triggers to run the search index update without Lambda
Solution
Step 1: Identify event-driven update method
Using DynamoDB Streams to trigger Lambda on data changes is efficient and real-time.
Step 2: Evaluate alternatives
Polling wastes resources, embedding code in DynamoDB is not possible, and DynamoDB triggers require Lambda.
Final Answer:
Enable DynamoDB Streams, trigger Lambda on changes, and update the search index inside Lambda -> Option C
Quick Check:
Event-driven updates with Streams + Lambda = A [OK]
Hint: Use Streams + Lambda for real-time updates, avoid polling [OK]
Common Mistakes:
Choosing polling instead of event triggers
Thinking DynamoDB can run code internally
Ignoring the need for Lambda in triggers
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.