DVA-C02 practice question 33 of 35

An application ingests data from an Amazon Kinesis data stream. The shards in the data stream are set for normal traffic. During tests for peak traffic, the application ingests data slowly. A developer needs to adjust the data stream to handle the peak traffic. What should the developer do to meet this requirement MOST cost-effectively?

Full set: 598 questions

Domain Development with AWS Services

Answer options
A: Install the Kinesis Producer Library {KPL) to ingest data into the data stream.
B: Switch to on-demand capacity mode for the data stream. Specify a partition key when writing data to the data stream.
C: Decrease the amount of time that data is kept in the data stream by using the DecreaseStreamRetention Period API operation.
D: Increase the shard count in the data stream by using the UpdateShardCount API operation. Correct answer
Correct Answer:
D. Increase the shard count in the data stream by using the UpdateShardCount API operation.
Explanation

The throughput of an Amazon Kinesis data stream is directly proportional to its number of shards. Each shard provides a fixed write capacity of 1 MB/s or 1,000 records/s. When data ingestion slows during peak traffic, it indicates that the producers are being throttled because the stream's total write capacity is exceeded. The most direct and cost-effective solution for a provisioned stream with predictable peaks is to increase the number of shards using the UpdateShardCount API operation. This process, known as resharding, scales the stream's capacity to handle the higher load.

Why Incorrect

A. The Kinesis Producer Library (KPL) optimizes writes through aggregation and batching but cannot overcome the fundamental throughput limits of the stream's shard configuration. The stream itself is the bottleneck.
B. Switching to on-demand mode would solve the capacity issue but is generally less cost-effective than manually scaling a provisioned stream for predictable peak traffic, as on-demand pricing is higher.
C. The data retention period determines how long data is stored. It has no impact on the stream's ingestion rate or throughput capacity and will not resolve the slow ingestion problem.

References

1. AWS Kinesis Data Streams Developer Guide, "Changing the Number of Open Shards (Resharding)": "The throughput of a Kinesis data stream is a function of the number of shards. You can increase or decrease the number of shards in a stream as needed. For example, you can scale the number of shards up when data volume increases." This directly supports increasing the shard count to handle more traffic.

2. AWS Kinesis Data Streams Developer Guide, "Choosing the data stream capacity mode": "With provisioned mode, you specify the number of shards for the data stream. The total capacity of a data stream is the sum of the capacities of its shards... We recommend that you use the provisioned mode when your data traffic is predictable and you can forecast your capacity requirements." This confirms that for predictable traffic (like a peak test), provisioned mode with scaling is the intended, cost-effective pattern.

3. AWS Kinesis Data Streams API Reference, "UpdateShardCount": "This operation scales the shard count of the specified stream. Scaling the shard count is only supported for streams with the PROVISIONED shard count mode." This identifies the specific API call for the action described in the correct answer.

Scroll to Top