How can the developer ensure that all orders and updates are stored to Amazon S3 with the LEAST development effort?
Create a new Lambda function and a new API Gateway API endpoint. Configure the new Lambda function to write to the S3 bucket. Modify the original Lambda function to post updates to the new API endpoint.
Use Amazon Kinesis Data Streams to create a new data stream. Modify the Lambda function to publish orders to the data stream. Configure the data stream to write to the S3 bucket.
Enable DynamoDB Streams on the DynamoDB table. Create a new Lambda function. Associate the stream’s Amazon Resource Name (ARN) with the Lambda function. Configure the Lambda function to write to the S3 bucket as records appear in the table’s stream.
Modify the Lambda function to publish to a new Amazon Simple Notification Service (Amazon SNS) topic as the Lambda function receives orders. Subscribe a new Lambda function to the topic. Configure the new Lambda function to write to the S3 bucket as updates come through the topic.
Explanations:
This option requires the creation of a new Lambda function and a new API Gateway endpoint, which increases development effort. It also involves modifying the original Lambda function, adding complexity to the implementation.
While Kinesis Data Streams could be used to handle real-time data, implementing this solution involves more complexity than necessary. The developer must set up the data stream, modify the existing Lambda function, and manage additional AWS resources, which is not the least effort approach.
Enabling DynamoDB Streams allows for automatic capturing of changes in the DynamoDB table. A new Lambda function can be easily associated with the stream to write directly to the S3 bucket. This option requires minimal changes to the existing architecture and leverages existing AWS features efficiently.
This option introduces additional complexity by requiring the setup of an Amazon SNS topic and an additional Lambda function to process the messages. It adds unnecessary steps and resources, making it less efficient than using DynamoDB Streams.