Question #1023
As part of a microservices architecture, a company mandates that each service exclusively accesses its own database. The Shipping service, which uses Amazon DynamoDB, requires order status data stored in the Orders service's DynamoDB database. Both databases are managed independently.
What approach provides the simplest, decoupled, and reliable way to propagate near-real-time updates from the Orders database to the Shipping service?
Schedule regular AWS Glue jobs to replicate data from the Orders database to the Shipping database.
Implement Amazon ElastiCache in the Shipping service, with cache updates triggered by changes in the Orders database.
Configure Amazon Kinesis Data Firehose to stream all Orders database changes to the Shipping database.
Leverage Amazon DynamoDB Streams to capture and forward changes from the Orders database to the Shipping service.
Explanation
Answer D is correct because:
- DynamoDB Streams natively captures item-level changes (inserts, updates, deletes) in near-real-time, ensuring reliability and low latency.
- Using AWS Lambda to process the stream allows the Shipping service to update its database without direct coupling, maintaining microservice independence.
- Why other options are incorrect:
- A: AWS Glue jobs are batch-based, introducing delays, and are not suitable for near-real-time requirements.
- B: ElastiCache adds complexity by requiring cache invalidation logic and does not guarantee data persistence in the Shipping database.
- C: Kinesis Data Firehose focuses on batch delivery to storage/services (e.g., S3, Redshift), not direct DynamoDB-to-DynamoDB synchronization.
Key Points: Use DynamoDB Streams for real-time event-driven architectures; avoid batch solutions (Glue, Firehose) and caching (ElastiCache) for direct data propagation.
Answer
The correct answer is: D