AWS DevOps Engineer Certification: DynamoDB Stream Integration for Real-Time Notifications

Integrating DynamoDB Stream for Real-Time Notifications

Prev Question Next Question

Question

You work in a startup company, and your team is developing a new Android App.

Whenever a user uploads a photo in the App, a notification will be sent to his friends immediately.

An AWS DynamoDB table has been created to save the photo information per user, and the DynamoDB Stream is enabled to capture the item modifications.

Which service can integrate with DynamoDB Stream, process its events and send notifications?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - A.

The Stream feature can be enabled in DynamoDB as below:

After it is enabled, a time-ordered sequence of item-level operations is captured which can be accessed via its API.

Option A is CORRECT: Because DynamoDB Stream can be configured as a trigger for a Lambda function which picks up a new stream record and gets it processed.

Option B is incorrect: Because SNS notification cannot integrate with DynamoDB Streams.

Refer to.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html

Option C is incorrect: Although CloudWatch Events can filter an event from the DynamoDB API call, DynamoDB Stream cannot be set up as a source.

The option does not match the requirements of the question.

Option D is incorrect: Because the S3 bucket cannot pull or process events from DynamoDB Stream.

Manage Stream

View type © Keys only - only the key attributes of the modified item
O New image - the entire item, as it appears after it was modified
© Old image - the entire item, as it appeared before it was modified
@ New and old images - both the new and the old images of the item

The correct answer is A. A Lambda function.

AWS DynamoDB Stream is a feature that allows capturing and processing changes to a DynamoDB table in real-time. When enabled, DynamoDB Stream captures the information about the item changes, including the nature of the change and the data that was affected. The changes are then made available to AWS services to allow them to react in real-time.

In the given scenario, whenever a user uploads a photo in the Android app, the photo information is saved in a DynamoDB table. The DynamoDB Stream is enabled to capture the item modifications. The goal is to send notifications to the user's friends immediately. Therefore, an AWS service is required to integrate with DynamoDB Stream, process its events, and send notifications.

Out of the options given, A Lambda function is the most appropriate service for this scenario. A Lambda function is a serverless compute service that allows running code without provisioning or managing servers. Lambda can be triggered by various AWS services, including DynamoDB Stream, which allows it to react to changes in real-time.

The Lambda function can be written to process the events from DynamoDB Stream and send notifications to the user's friends using an appropriate notification service, such as SNS (Simple Notification Service). Alternatively, the Lambda function can be used to directly send the notifications using any available SDK for the target notification service.

Therefore, the correct answer is A. A Lambda function.