Course menuDVA-C02

Exams / DVA-C02 / Streaming data with Kinesis / Question 1

DVA-C02 practice question: Streaming data with Kinesis (1 of 2)

Development with AWS Services A free question from our original DVA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

An IoT application writes sensor readings to an Amazon Kinesis data stream with 20 shards. The producer uses the device model as the partition key, and there are only three device models. Writes fail with ProvisionedThroughputExceededException even though overall stream traffic is well below the capacity of 20 shards. What should the developer do?

Choose one answer.

  1. A. Use a high-cardinality value such as the device ID as the partition key.
  2. B. Double the number of shards in the stream.
  3. C. Switch the producer from PutRecords to PutRecord calls.
  4. D. Use the device model plus the current date as the partition key.
Show the answer and explanation

Answer: A

  • A. Right: Correct. Many distinct keys hash across all shards, spreading writes evenly.
  • B. Wrong: With only three partition key values, the data still lands on at most three shards. More shards would sit idle.
  • C. Wrong: Sending one record per call changes batching, not where the records go. The same few shards stay overloaded.
  • D. Wrong: This adds little cardinality: on any given day there are still only three key values, so the same hot shards remain.

Explanation

Kinesis hashes each partition key with MD5 to choose a shard, so every record with the same key goes to the same shard. A key with few distinct values creates hot shards no matter how many shards exist. A high-cardinality key spreads the load across the whole stream.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.