Soru

Zorluk: KolayStream Processing and Event Routing with Amazon Kinesis and EventBridge

A developer is configuring a multiplayer game server to send real-time player action logs to an Amazon Kinesis Data Stream with four shards. The developer notices that one shard is constantly throttled, causing the producer to receive ProvisionedThroughputExceededException errors, while the other three shards are barely utilized. Upon inspecting the application code, the developer finds that the partition key in the PutRecord API call is set to a constant string value: "PlayerAction". Which modification should the developer make to resolve this throttling issue?

  1. Change the partition key to use the unique ID of the player performing each action.Cevap
  2. B
    Change the partition key to use the static name of the game server instance.
  3. C
    Increase the visibility timeout of the Kinesis Data Stream consumer application.
  4. D
    Modify the IAM trust policy of the game server role to allow cross-account access.

Cevap

Change the partition key to use the unique ID of the player performing each action.
The correct answer is to use the unique ID of the player performing each action as the partition key. Amazon Kinesis Data Streams uses the partition key to group data by shard. The partition key is hashed, and the hash value determines which shard the record is assigned to. By using a high-entropy key like a unique player ID, data is distributed evenly across all shards, preventing any single shard from becoming a hot shard and causing throttling.

Adım Adım Çözüm

1
Identify the root cause of the ProvisionedThroughputExceededException errors by checking shard utilization.
One shard is heavily utilized (hot shard) while the other three are idle, pointing to uneven data distribution.
Throttling occurs when a single shard's capacity limit of 1 MB/s or 1,000 records/s is exceeded.
2
Inspect the partition key design in the producer application code.
The partition key is found to be the static string "PlayerAction" for all records.
A static partition key hashes to the same value, causing Kinesis to route all records to a single shard.
3
Select and implement a high-entropy partition key.
Replace the static partition key with the unique player ID.
A high-cardinality key like a unique player ID distributes data evenly across all shards using Kinesis's hashing mechanism.

Anahtar Kavram

Kinesis Shard Throttling and Partition Key Selection
Bu soruyu puanla