AWS Certified Solutions Architect – Associate (SAA-C02) — Question 572
A company has an API that receives real-time data from a fleet of monitoring devices. The API stores this data in an Amazon RDS DB instance for later analysis.
The amount of data that the monitoring devices send to the API fluctuates. During periods of heavy traffic, the API often returns timeout errors.
After an inspection of the logs, the company determines that the database is not capable of processing the volume of write traffic that comes from the API. A solutions architect must minimize the number of connections to the database and must ensure that data is not lost during periods of heavy traffic.
Which solution will meet these requirements?
Answer options
- A. Increase the size of the DB instance to an instance type that has more available memory.
- B. Modify the DB instance to be a Multi-AZ DB instance. Configure the application to write to all active RDS DB instances.
- C. Modify the API to write incoming data to an Amazon Simple Queue Service (Amazon SQS) queue. Use an AWS Lambda function that Amazon SQS invokes to write data from the queue to the database.
- D. Modify the API to write incoming data to an Amazon Simple Notification Service (Amazon SNS) topic. Use an AWS Lambda function that Amazon SNS invokes to write data from the topic to the database.
Correct answer: C
Explanation
Using Amazon SQS decouples the API from the database, acting as a buffer that prevents data loss during traffic spikes. By using an AWS Lambda function triggered by SQS with a controlled concurrency limit, the architecture can regulate the write rate and minimize active connections to the Amazon RDS database. Other options, such as using SNS or scaling the DB instance, do not offer queueing buffers with connection throttling capabilities.