A company is building an application that is going to make use of Kinesis streams.
They are going to develop the producer and consumer parts of the application.
There is a requirement to ensure the strict ordering of records send and processed in the stream.
Which of the following would help ensure this? Choose 2 answers from the options given below.
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - A and C.
The AWS Documentation mentions the following.
The response Records array includes both successfully and unsuccessfully processed records.
Kinesis Data Streams attempts to process all records in each PutRecords request.
A single record failure does not stop the processing of subsequent records.
As a result, PutRecords doesn't guarantee the ordering of records.
If you need to read records in the same order they are written to the stream, use PutRecord instead of PutRecords, and write to the same shard.
For more information on putting a series of records, please refer to the below URL.
https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.htmlTo ensure strict ordering of records in a Kinesis stream, two options can be considered:
Directing records to a particular shard: Kinesis streams are composed of multiple shards, which are the basic building blocks of Kinesis data streams. Each shard has a sequence of data records, and each record in the shard is identified by a sequence number. When records are sent to a particular shard, they are processed in the order in which they arrive in the stream. By directing records to a particular shard, the strict ordering of records can be ensured.
Using the PutRecord API command: When using the PutRecord API command, each record is sent individually, and the ordering of records is guaranteed by the sequence number assigned to each record. Therefore, using the PutRecord API command can also help ensure strict ordering of records in a Kinesis stream.
On the other hand, using the PutRecords API command sends multiple records in a single request, and there is no guarantee that the records will be processed in the order in which they were sent.
Therefore, option A (Ensure to use the PutRecord API command) and option C (Ensure that records are directed towards a particular shard) are the correct answers to the question. Options B and D are not relevant to ensuring strict ordering of records in a Kinesis stream.