You're working on an existing application that writes its state data to an Amazon DynamoDB Table using the PutItem API. You want to build an asynchronous, event-driven observer mechanism that watches for item-level changes happening in this existing DynamoDB Table and invoke a Lambda function to publish a message to an Amazon Simple Notification Service (SNS) Topic of the change. What is the lowest cost solution while still using DynamoDB?Use Amazon Kinesis Firehose: as an item is written to the Amazon DynamoDB Table, Amazon Kinesis Firehose writes the data to Amazon S3 bucket. The Amazon S3 bucket is configured with an onCreate event to invoke a Lambda function that publishes a message to an Amazon SNS Topic.Update the existing application's implementation to write its state data to Amazon DynamoDB Table, then conditionally wait for a '200 OK' response from the PutItem API before invoking the Lambda function to publish a message to an Amazon Simple Notification Service SNS Topic.Use Amazon DynamoDB Streams: as an item is written to the Amazon DynamoDB Table, a new stream record is written to reflect the item-level change that has happened to the table. This new stream record invokes a Lambda function, reading the data from the stream record, and publishes a message to an Amazon Simple Notification Service (SNS) Topic.Creating an Amazon EventBridge rule that runs on a regular schedule which invokes a Lambda function. This Lambda function performs a scan operation of the Amazon DynamoDB Table, and performs a diff against its last invocation. If there's a difference, a message is published to an Amazon Simple Notification Service (SNS) Topic.
Question
You're working on an existing application that writes its state data to an Amazon DynamoDB Table using the PutItem API. You want to build an asynchronous, event-driven observer mechanism that watches for item-level changes happening in this existing DynamoDB Table and invoke a Lambda function to publish a message to an Amazon Simple Notification Service (SNS) Topic of the change. What is the lowest cost solution while still using DynamoDB?Use Amazon Kinesis Firehose: as an item is written to the Amazon DynamoDB Table, Amazon Kinesis Firehose writes the data to Amazon S3 bucket. The Amazon S3 bucket is configured with an onCreate event to invoke a Lambda function that publishes a message to an Amazon SNS Topic.Update the existing application's implementation to write its state data to Amazon DynamoDB Table, then conditionally wait for a '200 OK' response from the PutItem API before invoking the Lambda function to publish a message to an Amazon Simple Notification Service SNS Topic.Use Amazon DynamoDB Streams: as an item is written to the Amazon DynamoDB Table, a new stream record is written to reflect the item-level change that has happened to the table. This new stream record invokes a Lambda function, reading the data from the stream record, and publishes a message to an Amazon Simple Notification Service (SNS) Topic.Creating an Amazon EventBridge rule that runs on a regular schedule which invokes a Lambda function. This Lambda function performs a scan operation of the Amazon DynamoDB Table, and performs a diff against its last invocation. If there's a difference, a message is published to an Amazon Simple Notification Service (SNS) Topic.
Solution
The most cost-effective solution while still using DynamoDB would be to use Amazon DynamoDB Streams. Here's how you can do it:
-
As an item is written to the Amazon DynamoDB Table, a new stream record is written to reflect the item-level change that has happened to the table.
-
This new stream record invokes a Lambda function. The Lambda function reads the data from the stream record.
-
The Lambda function then publishes a message to an Amazon Simple Notification Service (SNS) Topic.
This solution is the most cost-effective because it doesn't require any additional storage (like an Amazon S3 bucket) or changes to the existing application's implementation. It also doesn't require regular scanning of the DynamoDB Table, which could increase costs. Instead, it uses the built-in functionality of DynamoDB Streams to trigger a Lambda function whenever an item-level change occurs in the table.
Similar Questions
A Company is designing a high availability solution for a customer. This customer's requirements are that their application needs to be able to handle an unexpected amount of load and allow site visitors to read data from a DynamoDB table, which contains the results of an online polling system. Given this information, what would be the best and most cost-saving method for architecting and developing this application?Select one:a. Use the JavaScript SDK and build a static HTML page, hosted inside of an Amazon S3bucket; use CloudFront and Route 53 to serve the website, which uses JavaScript client-sidelanguage to communicate with DynamoDBb. Create a CloudFront distribution that serves the HTML web page, but send the visitors to an Auto Scaling ELB application pointing to EC2 instances c. Create a Lambda script, which pulls the most recent DynamoDB polling results and creates a custom HTML page, inside of Amazon S3 and use CloudFront and Route 53 to servethe static websited. Deploy an Auto Scaling application with Elastic Load Balancer pointing to EC2 instances that use a server-side SDK to communicate with the DynamoDB table
A food and grocery delivery company is building a mobile application for their customers using AWS serverless services. As an architect you are asked to design the backend AWS solution architecture for the mobile app using event driven architecture. One of the features of the app is to provide real time updates to the user about the order delivery status.What would be the efficient design for this feature to enable bi-directional communication between the API backend and the app?Webhooks with Amazon Simple Notification Service (Amazon SNS)Amazon API Gateway WebSocketsPublish Subscribe model using message queueClient polling an AWS Lambda API
A digital marketing company needs to deliver real-time, personalized experiences to its customers through their application. They want to store and retrieve users' preferences and track users' activities. The solution needs to be scalable and provide low-latency access to data. Which AWS service would you recommend for this requirement?Question 27Answera.Amazon ElastiCacheb.AWS Lambdac.Amazon Redshiftd.Amazon RDS
Question 2An application needs to process events that are received through an API. Multiple consumers must be able to process the data concurrently. Which AWS managed service would best meet this requirement in the most cost-effective way?1 pointAmazon Simple Notification Service (Amazon SNS) with a fan-out strategyAmazon Simple Queue Service (Amazon SQS) with FIFO queuesAmazon EventBridge with rulesAmazon Elastic Compute Cloud (Amazon EC2) with Spot Instances
Does Dynamo DB sacrifice Consistency for Scalability and Latency?If yes, which design element or service level agreement specifies this? If no, how this couldbe achieved?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.