AWS Certified Solutions Architect - Associate / Question #1481 of 1019

Question #1481

A company operates a customer feedback system hosted on an Amazon EC2 instance that stores data in an Amazon RDS MySQL database. During peak traffic periods, the system experiences delays in processing feedback submissions efficiently.

What should a solutions architect do to ensure feedback is reliably written to the database as quickly as possible?

A

Increase the EC2 instance size during peak traffic. Write feedback data to Amazon Simple Notification Service (Amazon SNS). Subscribe the RDS database endpoint to the SNS topic.

B

Write feedback data to an Amazon Simple Queue Service (Amazon SQS) queue. Use EC2 instances in an Auto Scaling group behind an Application Load Balancer to read from the SQS queue and process submissions into the database.

C

Write feedback data to Amazon Simple Notification Service (Amazon SNS). Subscribe the RDS database endpoint to the SNS topic. Use EC2 instances in an Auto Scaling group behind an Application Load Balancer to read from the SNS topic.

D

Write feedback data to an Amazon Simple Queue Service (Amazon SQS) queue when the EC2 instance reaches CPU threshold limits. Use scheduled scaling of EC2 instances in an Auto Scaling group behind an Application Load Balancer to read from the SQS queue and process submissions into the database.

Explanation

Answer B is correct because:
1. SQS Queue for Decoupling: Writing feedback data to an SQS queue decouples the submission process from database writes, preventing bottlenecks during peak traffic.
2. Auto Scaling for Elasticity: EC2 instances in an Auto Scaling group can dynamically scale based on the SQS queue size, ensuring sufficient processing capacity to handle submissions efficiently.
3. Reliability: SQS ensures messages are retained until processed, preventing data loss during high traffic.

Other options are incorrect because:
- A: RDS cannot subscribe to SNS, and scaling EC2 alone does not address database write bottlenecks.
- C: SNS does not retain messages, and EC2 instances would process duplicate messages via pub/sub.
- D: Triggering SQS writes based on CPU thresholds and scheduled scaling is less responsive than scaling based on queue depth.

Key Points: Use SQS for buffering and Auto Scaling based on queue metrics to handle variable workloads reliably.

Answer

The correct answer is: B