How to notify failed DynamoDB sales above a price threshold with least effort?
A company that has large online business uses an Amazon DynamoDB table to store sales data. The company enabled Amazon DynamoDB Streams on the table. The transaction status of each sale is stored in a TransactionStatus attribute in the table. The value of the TransactionStatus attribute must be either failed, pending, or completed. The company wants to be notified of failed sales where the Price attribute is above a specific threshold. A developer needs to set up notification for the failed sales. Which solution will meet these requirements with the LEAST development effort?
Community Votes
77% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The question tests whether candidates know that Lambda event filtering can evaluate DynamoDB Stream record payloads (including numeric comparisons) so the function is invoked only when conditions match, reducing development effort.
Use DynamoDB Streams with an AWS Lambda event source mapping and Lambda event filtering to trigger notifications only for failed high-value sales, minimizing code and invocation overhead.
Many candidates pick option C, assuming DynamoDB Streams can be wired directly to an SNS topic with an SNS subscription filter policy; in reality, DynamoDB Streams only support Lambda (and a few other services) as event source destinations, not SNS directly.
Community Discussion (7 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
The requirement is to notify only when TransactionStatus is failed AND Price exceeds a threshold, with the LEAST development effort. The optimal pattern is:
- Enable DynamoDB Streams (already done).
- Create an event source mapping from the stream to an AWS Lambda function.
- Use Lambda event filtering to restrict invocations to records where
dynamodb.NewImage.TransactionStatus.S = "failed"anddynamodb.NewImage.Price.Nsatisfies a numeric condition such as["numeric": [">", threshold]]. - Inside the tiny Lambda handler, publish the filtered payload to an Amazon SNS topic.
Why the other options are wrong:
- Option B also uses Lambda + SNS, but performs the filtering inside the handler code. This works, but it requires writing, testing, and maintaining conditional logic in the function, so it is more development effort than using native event filtering.
- Option C claims you can map DynamoDB Streams directly to an SNS topic and rely on SNS filter policies. DynamoDB Streams does not support SNS as a direct event source destination; it supports Lambda, Kinesis Data Streams, and a few other targets. Therefore this design is not feasible.
- Option D suggests using a CloudWatch alarm on DynamoDB Streams data. CloudWatch alarms operate on metrics, not on individual stream records or attribute values, so they cannot evaluate per-record conditions like "TransactionStatus = failed and Price > X". This option is architecturally incorrect.
Official Reference
Exam Strategy
When a question emphasizes 'LEAST development effort' and involves per-record attribute conditions on a stream, immediately look for the answer that uses native event filtering at the event source mapping rather than in-function logic. Also eliminate options that wire DynamoDB Streams to unsupported targets like SNS directly.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →