AWS Certified Solutions Architect – Associate (SAA-C02) — Question 760
A company has an application that processes customer orders. The company hosts the application on an Amazon EC2 instance that saves the orders to an
Amazon Aurora database. Occasionally when traffic is high, the workload does not process orders fast enough.
What should a solutions architect do to write the orders reliably to the database as quickly as possible?
Answer options
- A. Increase the instance size of the EC2 instance when traffic is high. Write orders to Amazon Simple Notification Service (Amazon SNS). Subscribe the database endpoint to the SNS topic.
- B. Write orders 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 orders into the database.
- C. Write orders to Amazon Simple Notification Service (Amazon SNS). Subscribe the 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 orders 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 orders into the database.
Correct answer: B
Explanation
Using Amazon SQS decouples the order ingestion from the processing layer, buffering incoming orders safely so that they are not lost during traffic spikes. The Auto Scaling group of EC2 instances can then scale dynamically based on the queue depth to process these orders and reliably write them to the Amazon Aurora database. Options involving Amazon SNS are incorrect because you cannot directly subscribe an Amazon Aurora database endpoint to an SNS topic, and scheduled scaling is not suitable for unpredictable traffic surges.