AWS Certified Solutions Architect – Associate (SAA-C02) — Question 316
A company plans to host a survey website on AWS. The company anticipates an unpredictable amount of traffic. This traffic results in asynchronous updates to the database. The company wants to ensure that writes to the database hosted on AWS do not get dropped.
How should the company write its application to handle these database requests?
Answer options
- A. Configure the application to publish to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the database to the SNS topic.
- B. Configure the application to subscribe to an Amazon Simple Notification Service (Amazon SNS) topic. Publish the database updates to the SNS topic.
- C. Use Amazon Simple Queue Service (Amazon SQS) FIFO queues to queue the database connection until the database has resources to write the data.
- D. Use Amazon Simple Queue Service (Amazon SQS) FIFO queues for capturing the writes and draining the queue as each write is made to the database.
Correct answer: D
Explanation
Using Amazon SQS FIFO queues allows the application to decouple database writes, buffering incoming requests during traffic spikes so that no writes are dropped. Amazon SNS (Options A and B) is a pub/sub service and cannot directly queue database write operations to prevent data loss. Option C is incorrect because SQS is used to queue write payloads/messages, not the physical database connections themselves.