A developer wants to insert a record into an Amazon DynamoDB table as soon as a new file is added to an Amazon S3 bucket. Which set of steps would be necessary to achieve this?
A.
Create an event with Amazon EventBridge that will monitor the S3 bucket and then insert the records into DynamoDB.
B.
Configure an S3 event to invoke an AWS Lambda function that inserts records into DynamoDB.
C.
Create an AWS Lambda function that will poll the S3 bucket and then insert the records into DynamoDB.
D.
Create a cron job that will run at a scheduled time and insert the records into DynamoDB.
The correct answer is B.
To insert a record into DynamoDB as soon as a new file is added to an S3 bucket, you can configure an S3 event notification to invoke an AWS Lambda function that inserts the records into DynamoDB. When a new file is added to the S3 bucket, the S3 event notification will trigger the Lambda function, which will insert the record into the DynamoDB table.
Option A is incorrect because Amazon EventBridge is not necessary to achieve this. S3 event notifications can directly invoke a Lambda function to insert records into DynamoDB.
Option C is incorrect because polling the S3 bucket periodically to check for new files is inefficient and not necessary with S3 event notifications.
Option D is incorrect because running a cron job at a scheduled time is not real-time and would not insert the record into DynamoDB as soon as a new file is added to the S3 bucket.
A) Eliminated - This approach introduces unnecessary complexity when S3 already supports native event notifications to Lambda.
B) Correct - S3 has native support for event notifications to trigger Lambda functions
C) Eliminated - Polling is inefficient and unnecessary
D) Eliminated - This is a time-based solution, not event-driven, meaning there could be a delay between the file being added and the record being inserted.
==> Discard A: EventBridge is unnecessary because S3 already provides direct event notifications.
==> Discard C: Polling violates the "as soon as" requirement due to delay and inefficiency.
==> Discard D: Cron jobs do not respond immediately, violating the "as soon as" requirement.
B is correct because S3 event notifications can trigger a Lambda function immediately when a new file is added, ensuring real-time insertion into DynamoDB.
B is better than A because S3 event notifications directly trigger a Lambda function, eliminating the need for additional configuration or services like EventBridge, making it simpler and more efficient.
A is also a solution for this which is better if we want loose coupling but will introduce a slight latency. The key word here is "as soon as" so the correct answer will be B.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Bibay
Highly Voted 1 year, 1 month agoUntamables
Highly Voted 1 year, 3 months agosumanshu
Most Recent 2 weeks agotrieudo
3 weeks, 1 day ago65703c1
1 month, 2 weeks agoJohnPl
5 months, 3 weeks agosvrnvtr
1 year, 3 months ago