
Answer-first summary for fast verification
Answer: Write the messages to an Amazon Kinesis data stream with the payment ID as the partition key., Write the messages to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the message group to use the payment ID.
## Explanation This question addresses the requirement for **message ordering by payment ID** in a payment processing system. Let's analyze each option: **Correct Answers:** **B. Write the messages to an Amazon Kinesis data stream with the payment ID as the partition key.** - **Kinesis Data Streams** guarantees ordering of records within a shard (partition). - When you use payment ID as the partition key, all messages with the same payment ID go to the same shard. - This ensures that messages for a specific payment ID are processed in the order they were sent. **E. Write the messages to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the message group to use the payment ID.** - **SQS FIFO queues** provide exactly-once processing and first-in-first-out delivery. - Message groups ensure that messages within the same group are processed in order. - By setting the message group ID to the payment ID, all messages for that payment ID will be processed sequentially. **Incorrect Options:** **A. Write the messages to an Amazon DynamoDB table with the payment ID as the partition key.** - DynamoDB is a NoSQL database, not a message queue. - While it can store data with ordering within a partition key, it doesn't provide message queuing capabilities with guaranteed ordering for processing. **C. Write the messages to an Amazon ElastiCache for Memcached cluster with the payment ID as the key.** - ElastiCache for Memcached is an in-memory caching service. - It doesn't provide message queuing capabilities or guaranteed ordering. - Memcached is designed for caching, not for ordered message processing. **D. Write the messages to an Amazon Simple Queue Service (Amazon SQS) queue. Set the message attribute to use the payment ID.** - Standard SQS queues don't guarantee FIFO ordering. - Messages might be delivered out of order, which violates the requirement. - Message attributes are metadata about the message, not a mechanism for ordering. **Key AWS Services for Ordered Message Processing:** 1. **Amazon Kinesis Data Streams** - Provides ordering within shards using partition keys 2. **Amazon SQS FIFO queues** - Guarantees exactly-once processing and FIFO delivery with message groups Both solutions ensure that messages for the same payment ID are processed in the order they were sent, which is critical for payment processing systems to avoid incorrect payment handling.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company uses a payment processing system that requires messages for a particular payment ID to be received in the same order that they were sent. Otherwise, the payments might be processed incorrectly.
Which actions should a solutions architect take to meet this requirement? (Choose two.)
A
Write the messages to an Amazon DynamoDB table with the payment ID as the partition key.
B
Write the messages to an Amazon Kinesis data stream with the payment ID as the partition key.
C
Write the messages to an Amazon ElastiCache for Memcached cluster with the payment ID as the key.
D
Write the messages to an Amazon Simple Queue Service (Amazon SQS) queue. Set the message attribute to use the payment ID.
E
Write the messages to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the message group to use the payment ID.