An Amazon Kinesis Data Streams application is lagging behind. The data records are small (1 KB) and the shard count is 10. The consumer uses the KCL with default configuration. Which action will MOST effectively reduce the consumer lag?
Trap 1: Increase the number of KCL workers per shard (e.g., 2 workers per…
The KCL does not support multiple workers per shard; each shard is processed by a single worker sequentially. Therefore, increasing workers per shard is not a valid configuration.
Trap 2: Increase the number of shards to 20.
Increasing the number of shards can help if the shard is saturated with incoming data, but the problem is consumer lag (processing speed), not ingestion throughput. Enhanced Fan-Out is more targeted.
Trap 3: Reduce the record size by compressing the data.
Compressing records reduces data size, which can improve throughput, but does not address the consumer's processing latency. The records are small (1 KB) already, so compression offers minimal benefit.
- A
Increase the number of KCL workers per shard (e.g., 2 workers per shard).
Why wrong: The KCL does not support multiple workers per shard; each shard is processed by a single worker sequentially. Therefore, increasing workers per shard is not a valid configuration.
- B
Use Enhanced Fan-Out to provide dedicated throughput.
Enhanced Fan-Out provides each consumer with dedicated throughput (2 MB/s per shard) and push-based delivery, which reduces latency and lag directly. This is the most effective action to reduce consumer lag given the scenario.
- C
Increase the number of shards to 20.
Why wrong: Increasing the number of shards can help if the shard is saturated with incoming data, but the problem is consumer lag (processing speed), not ingestion throughput. Enhanced Fan-Out is more targeted.
- D
Reduce the record size by compressing the data.
Why wrong: Compressing records reduces data size, which can improve throughput, but does not address the consumer's processing latency. The records are small (1 KB) already, so compression offers minimal benefit.