An e-commerce platform needs to ingest JSON-formatted checkout transactions that must be processed in the exact order they are received per customer to prevent out-of-order inventory inconsistencies. During high-traffic events, the platform experiences predictable peaks of up to transactions per second, with an average payload size of per transaction. The ingestion solution must deliver these transactions to a backend processing application with sub-second latency while preserving order. Which ingestion architecture should a solutions architect recommend to meet these requirements with optimal performance?
- Use Amazon Kinesis Data Streams provisioned with shards, utilizing the customer ID as the partition key for the incoming stream.Answer
- BUse Amazon Kinesis Data Streams provisioned with shard, relying on consumer group auto-scaling to process the message stream.
- CUse an Amazon SQS Standard queue to decouple the ingestion tier and buffer messages before they are processed by the consumer application.
- DUse an Amazon SQS FIFO queue with a single message group ID to distribute the workload across multiple concurrent consumer instances.
Answer
Use Amazon Kinesis Data Streams provisioned with shards, utilizing the customer ID as the partition key for the incoming stream.
The correct architecture uses Amazon Kinesis Data Streams provisioned with at least shards and partition keys based on the customer ID. A single Kinesis Data Streams shard supports a maximum write capacity of or records per second. The application's peak requirements ( and write requests per second) exceed the capacity of a single shard, meaning at least shards must be provisioned to prevent ingestion throttling. Additionally, utilizing the customer ID as the partition key ensures that transactions for each individual customer are hashed to the same shard, preserving the exact ingestion order for processing.
Step-by-Step Solution
Key Concept
Determining stream shard capacity based on write throughput/record limits, and leveraging partition keys to guarantee order preservation in Amazon Kinesis Data Streams.
Estimated Time:2m 0s