
Answer-first summary for fast verification
Answer: Publish the messages to an Amazon Simple Notification Service (Amazon SNS) topic with multiple Amazon Simple Queue Service (Amazon SQS) subscriptions. Configure the consumer applications to process the messages from the queues.
## Explanation **Option D is the correct answer** because it provides the best solution for decoupling and scalability requirements. ### Analysis of each option: **Option A: Amazon Kinesis Data Analytics** - Kinesis Data Analytics is designed for real-time analytics and processing, not for message distribution to multiple consumers - Not suitable for fan-out scenarios where dozens of applications need to consume the same messages - Doesn't provide the decoupling needed between producers and multiple consumers **Option B: EC2 Auto Scaling group** - This only addresses scaling the ingestion application, not the overall architecture - Doesn't solve the decoupling requirement between the ingestion application and dozens of consumer applications - Consumer applications would still need to directly connect to the ingestion application - Doesn't handle the fan-out pattern needed for multiple consumers **Option C: Kinesis Data Streams with single shard** - Using a single shard creates a bottleneck and limits throughput to 1,000 records per second or 1 MB per second - The requirement mentions spikes to 100,000 messages per second, which a single shard cannot handle - Storing messages in DynamoDB adds unnecessary complexity and cost - Consumer applications reading from DynamoDB would need to implement polling mechanisms **Option D: SNS with multiple SQS subscriptions** - **✓ Decoupling**: SNS provides complete decoupling between message producers and consumers - **✓ Fan-out pattern**: SNS can fan out messages to multiple SQS queues, allowing dozens of applications to consume messages independently - **✓ Scalability**: Both SNS and SQS are fully managed services that scale automatically to handle spikes of 100,000 messages per second - **✓ Independent processing**: Each consumer application can process messages from its own SQS queue at its own pace - **✓ Reliability**: SQS provides message durability and at-least-once delivery - **✓ No bottlenecks**: No single shard or processing component limits throughput ### Key AWS services used in Option D: 1. **Amazon SNS (Simple Notification Service)**: Publishes messages to multiple subscribers (fan-out pattern) 2. **Amazon SQS (Simple Queue Service)**: Provides durable message queues for each consumer application This architecture allows the ingestion application to publish messages to an SNS topic once, and each consumer application subscribes to the topic via its own SQS queue. This provides true decoupling, high scalability, and independent processing for all consumer applications.
Ultimate access to all questions.
No comments yet.
Author: LeetQuiz Editorial Team
A company has an application that ingests incoming messages. Dozens of other applications and microservices then quickly consume these messages. The number of messages varies drastically and sometimes increases suddenly to 100,000 each second. The company wants to decouple the solution and increase scalability. Which solution meets these requirements?
A
Persist the messages to Amazon Kinesis Data Analytics. Configure the consumer applications to read and process the messages.
B
Deploy the ingestion application on Amazon EC2 instances in an Auto Scaling group to scale the number of EC2 instances based on CPU metrics.
C
Write the messages to Amazon Kinesis Data Streams with a single shard. Use an AWS Lambda function to preprocess messages and store them in Amazon DynamoDB. Configure the consumer applications to read from DynamoDB to process the messages.
D
Publish the messages to an Amazon Simple Notification Service (Amazon SNS) topic with multiple Amazon Simple Queue Service (Amazon SQS) subscriptions. Configure the consumer applications to process the messages from the queues.