Question

Difficulty: MediumHigh-Performing Data Ingestion and Transformation Solutions

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 1,6001,600 transactions per second, with an average payload size of 1 KB1 \text{ KB} 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?

  1. Use Amazon Kinesis Data Streams provisioned with 22 shards, utilizing the customer ID as the partition key for the incoming stream.Answer
  2. B
    Use Amazon Kinesis Data Streams provisioned with 11 shard, relying on consumer group auto-scaling to process the message stream.
  3. C
    Use an Amazon SQS Standard queue to decouple the ingestion tier and buffer messages before they are processed by the consumer application.
  4. D
    Use 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 22 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 22 shards and partition keys based on the customer ID. A single Kinesis Data Streams shard supports a maximum write capacity of 1 MB/s1 \text{ MB/s} or 1,0001,000 records per second. The application's peak requirements (1.6 MB/s1.6 \text{ MB/s} and 1,6001,600 write requests per second) exceed the capacity of a single shard, meaning at least 22 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

1
Calculate the total throughput requirements for the system during peak times.
Total write throughput is 1.6 MB/s1.6 \text{ MB/s} (1,600 transactions/sec×1 KB/transaction1,600 \text{ transactions/sec} \times 1 \text{ KB/transaction}) and the transaction rate is 1,6001,600 write requests per second.
This is necessary to determine the shard capacity or queue limits required to prevent ingestion bottlenecks.
2
Evaluate Kinesis Data Streams shard capacity constraints.
A single shard supports up to 1 MB/s1 \text{ MB/s} of write throughput or 1,0001,000 write records per second. Since the peak rate is 1.6 MB/s1.6 \text{ MB/s} and 1,6001,600 write requests per second, at least 22 shards are required.
To avoid ProvisionedThroughputExceededException errors during peak transaction periods.
3
Determine the partition key strategy for ordering.
Using the customer ID as the partition key routes all transactions for a specific customer to the same shard, guaranteeing in-order processing per customer.
The requirements dictate that events must be processed in the exact sequence they are received per customer.

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
Rate this question