Q52 — AWS SAA-C03 Ch.1

Question 52 of 65 | ← Chapter 1

Q52. A company has an application that ingests incoming messages. These messages are then quickly consumed by dozens of other applications and microservices. The number of messages varies drastically and sometimes spikes as high as 100 000 each second The company wants to decouple the solution and increase scalability.Which solution meets these requirements?

Correct Answer: D. Publish the messages to an Amazon Simple Notification Service (Amazon SNS) topic with one or more Amazon Simple Queue Service (Amazon SQS) subscriptions All applications then process the messages from the queues.

Explanation

To meet the requirements of decoupling the solution and increasing scalability for ingesting and consuming incoming messages, the best solution is option D: Publish the messages to an Amazon Simple Notification Service (Amazon SNS) topic with one or more Amazon Simple Queue Service (Amazon SQS) subscriptions. All applications can then process the messages from the queues. Here's why this solution is the most suitable: 1. Amazon Simple Notification Service (Amazon SNS): SNS is a fully managed pub/sub messaging service that enables the decoupling of message producers and consumers. It allows the application to publish messages to a topic without knowing the subscribers. 2. Amazon Simple Queue Service (Amazon SQS): SQS is a fully managed message queuing service that provides reliable and scalable message storage. Applications can subscribe to an SNS topic and receive messages through SQS queues, ensuring that messages are processed by multiple applications in a scalable manner. By implementing this solution, the company gains the following benefits: - Decoupling: SNS decouples the message producers from the consumers, allowing applications to publish messages to a topic without knowing the specific subscribers. This provides flexibility and loose coupling between the ingesting application and the consuming applications. - Scalability: SNS and SQS can handle high message throughput and scale to meet the varying message rates. SNS can fan out messages to multiple SQS queues, allowing parallel processing by the consuming applications. The number of SQS queues can be increased as needed to handle spikes in message volume. - Reliability: SQS provides reliable and durable message storage, ensuring that messages are not lost even during high message rates or application failures. Messages are stored in the queues until processed by the consuming applications, preventing message loss. Option A suggests persisting the messages to Amazon Kinesis Data Analytics. While Kinesis Data Analytics is suitable for real-time analytics on streaming data, it is not primarily designed for decoupling message producers and consumers. Option B suggests deploying the application on Amazon EC2 instances in an Auto Scaling group based on CPU metrics. While this solution can provide scalability, it does not address the decoupling requirement and may not be as flexible as using pub/sub messaging services like SNS and SQS. Option C suggests writing the messages to Amazon Kinesis Data Streams with a single shard. While Kinesis Data Streams can handle high message rates, it does not provide the same level of decoupling and scalability as the combination of SNS and SQS.