An API gateway service writes usage logs for a multi-tenant software application. Each log entry is a JSON object containing `tenant_id`, `request_id`, `timestamp`, and `response_time`. A developer configures Amazon Kinesis Data Streams to ingest these logs for real-time usage billing calculations. During peak hours, the stream encounters `ProvisionedThroughputExceededException` errors on a single shard, even though the total write throughput is well below the overall provisioned capacity of the stream. The developer discovers that the partition key is set to the tenant's geographic region, which has only three possible values. Which partition key strategy should the developer implement to resolve this issue and distribute the workload evenly across all shards?
- Use the request_id from each log entry as the partition key.Answer
- BSet a static string such as 'billing_stream' as the partition key for all records.
- CDeploy the consumer Lambda function inside a private VPC subnet without a NAT Gateway or VPC endpoint.
- DModify the trust policy of the consumer Lambda function's IAM role to allow the Kinesis Data Stream to assume the role.