A developer is implementing a serverless stream processing application. Real-time telemetry data is ingested into an Amazon Kinesis data stream. An AWS Lambda function is configured with an active event source mapping to process the stream records. The Lambda function is deployed within a private subnet of an Amazon VPC to securely access an internal database, but it also needs to make HTTP calls to an external API to enrich the incoming telemetry data. During testing, the developer observes that the Kinesis stream is experiencing a hot shard issue, resulting in ProvisionedThroughputExceededException errors on a single shard even though overall stream throughput is well below the limits, and the Lambda function fails to connect to the external API, causing execution timeouts. Which set of modifications will resolve both issues?
- Modify the producer to use a high-entropy value such as a combination of device identifier and timestamp as the partition key, and deploy a NAT Gateway in a public subnet with routing configured from the private subnet.Answer
- BModify the producer to use a static value such as the event status code as the partition key, and deploy a NAT Gateway in a public subnet with routing configured from the private subnet.
- CModify the producer to use a high-entropy value such as a combination of device identifier and timestamp as the partition key, and attach an Internet Gateway directly to the private subnet containing the Lambda function.
- DModify the producer to use a static value such as the event status code as the partition key, and increase the Lambda function execution timeout configuration to the maximum limit of 15 minutes.