A retail company is designing an event-driven system to process stock level updates from its physical stores. The updates must be processed in the exact order they occur for each product SKU to prevent database write conflicts and maintain accurate inventory levels. The system must also be able to scale and absorb sudden spikes in update traffic during promotional sales events.
Which solution meets these requirements with the least operational overhead?
- Publish the updates to an Amazon SNS FIFO topic. Subscribe an Amazon SQS FIFO queue to the topic, and configure an AWS Lambda function to process the messages from the queue.Cevap
- BPublish the updates to a standard Amazon SNS topic. Subscribe a standard Amazon SQS queue to the topic, and configure an AWS Lambda function to process the messages from the queue.
- CPublish the updates to a standard Amazon SQS queue, and configure an AWS Lambda function to consume the messages using FIFO consumer configuration.
- DPublish the updates to an Amazon Kinesis Data Stream configured with a single shard, and configure an AWS Lambda function to process the records sequentially.
Cevap
Publish the updates to an Amazon SNS FIFO topic, subscribe an Amazon SQS FIFO queue to the topic, and configure an AWS Lambda function to process the messages.
Utilizing an Amazon SNS FIFO topic combined with an Amazon SQS FIFO queue guarantees that messages are processed sequentially per product SKU (by using the SKU as the message group ID). This architecture ensures that stock updates are processed in the order they occurred, while AWS Lambda dynamically scales up to handle promotional traffic spikes without managing servers, minimizing operational overhead.
Adım Adım Çözüm
Anahtar Kavram
Decoupling and ensuring sequential event processing using FIFO SNS and SQS integration patterns.