DVA-C02 practice question 28 of 35

In a move toward using microservices, a company's management team has asked all development teams to build their services so that API requests depend…

Full set: 598 questions

Domain Security

In a move toward using microservices, a company's management team has asked all development teams to build their services so that API requests depend only on that service's data store. One team is building a Payments service which has its own database; the service needs data that originates in the Accounts database. Both are using Amazon DynamoDB. What approach will result in the simplest, decoupled, and reliable method to get near-real time updates from the Accounts database?
Answer options
A: Use AWS Glue to perform frequent ETL updates from the Accounts database to the Payments database.
B: Use Amazon ElastiCache in Payments, with the cache updated by triggers in the Accounts database.
C: Use Amazon Data Firehose to deliver all changes from the Accounts database to the Payments database.
D: Use Amazon DynamoDB Streams to deliver all changes from the Accounts database to the Payments database. Correct answer
Correct Answer:
D. Use Amazon DynamoDB Streams to deliver all changes from the Accounts database to the Payments database.
Explanation

Amazon DynamoDB Streams provides a time-ordered sequence of item-level modifications (create, update, delete) in a DynamoDB table. This feature is designed for near-real-time data processing. By enabling a stream on the Accounts table, a consumer application, such as an AWS Lambda function, can be triggered by these changes. This function can then process the event data and replicate the necessary information to the Payments service's database. This approach creates a decoupled, event-driven architecture that is reliable, simple to implement, and perfectly aligns with microservices principles by avoiding direct dependencies between services.

Why Incorrect

A. AWS Glue is an ETL service designed for batch data processing, which does not meet the near-real-time requirement and is overly complex for this use case.
B. Amazon ElastiCache is an in-memory caching service. It does not solve the core problem of persisting replicated data into the Payments service's own database.
C. Amazon Kinesis Data Firehose is used to load streaming data into destinations like Amazon S3 or Redshift, but it cannot directly write to a DynamoDB table.

References

1. Amazon DynamoDB Developer Guide: "DynamoDB Streams provides a time-ordered sequence of item-level changes in any DynamoDB table. [...] You can build applications that consume these streams and take action based on the contents. A common use case is to have a Lambda function that is invoked by a DynamoDB stream." (See the section "Change Data Capture for DynamoDB Streams").

2. AWS Documentation - Using AWS Lambda with Amazon DynamoDB: "A common use case for AWS Lambda is to process records from an Amazon DynamoDB stream. In this model, a Lambda function processes records from the stream as they are added. This is an ideal pattern for replicating data between tables..." (See the section "Tutorial: Process new items in a DynamoDB table").

3. AWS Whitepaper - Streaming Data Solutions on AWS with Amazon Kinesis: This paper details the use cases for Kinesis services. It shows Kinesis Data Firehose destinations as Amazon S3, Amazon Redshift, Amazon OpenSearch Service, and Splunk, confirming it does not natively target DynamoDB. (See the section "Amazon Kinesis Data Firehose").

Scroll to Top