Question

Difficulty: EasyStream Processing and Event Routing with Amazon Kinesis and EventBridge

A developer needs to configure an Amazon Kinesis Data Stream to ingest telemetry data from thousands of IoT devices. To ensure that data is distributed evenly across all shards, which TWO values should the developer select to use as the partition key? (Select TWO.)

  1. A unique device identifier (device_id)Answer
  2. B
    A timestamp representing the hour the event occurred
  3. A randomly generated transaction UUIDAnswer
  4. D
    A static string indicating the device manufacturer name
  5. E
    The source country code of the device location

Answer

The correct options are the unique device identifier (device_id) and the randomly generated transaction UUID.
Amazon Kinesis Data Streams use the partition key to determine which shard a record is sent to. By using high-cardinality, high-entropy values like a unique device identifier or a randomly generated UUID, the hash values are distributed evenly across the stream's shards, ensuring balanced throughput.

Step-by-Step Solution

1
Analyze how Kinesis Data Streams route records to shards using partition keys.
Kinesis applies an MD5 hash function to the partition key, mapping the hash value to a specific shard range.
Understanding the routing mechanism helps evaluate how different keys affect partition distribution.
2
Evaluate the cardinality and entropy of each proposed partition key option.
High-cardinality keys like unique device IDs and randomly generated UUIDs result in an even distribution of hash values across shards. Low-cardinality keys (like static names, hour timestamps, or country codes) concentrate writes on a small number of shards.
Selecting high-cardinality keys prevents ProvisionedThroughputExceededException caused by hot shards.

Key Concept

Partition key cardinality and shard distribution in Amazon Kinesis Data Streams
Rate this question