A healthcare monitoring application ingests real-time vital signs from patient wearable devices into an Amazon Kinesis Data Stream. During peak clinical hours, the producer applications report frequent ProvisionedThroughputExceededException errors. Upon analysis, the developer finds that the aggregate write throughput is significantly below the stream's provisioned limit, but a subset of shards is heavily throttled. The application uses the device manufacturer name as the partition key.
Which action should the developer take to resolve the write throttling?
- AUpdate the IAM policy of the producer role to modify the trust relationship policy document.
- Change the partition key to a unique identifier such as the patient's device ID.Answer
- CIncrease the execution timeout of the downstream AWS Lambda function that processes the Kinesis stream.
- DDeploy the downstream consumer AWS Lambda function in a private VPC subnet without a NAT Gateway.
Answer
Change the partition key to a unique identifier such as the patient's device ID.
Changing the partition key to a unique identifier, such as the patient's device ID, ensures high entropy. Kinesis uses the partition key hash value to determine which shard receives a data record. A high-cardinality key distributes the records evenly across all shards, resolving the hot shard problem and preventing write throttling.
Step-by-Step Solution
Key Concept
Selecting an appropriate Kinesis partition key with high cardinality/entropy to avoid hot shards.
Estimated Time:1m 30s