Dynamodb stream order of records

652 views Asked by At

I am populating records in dynamodb in the following sequence:

A11, A12, A13, A14, A15, A21, A22, A23, A24, A25, A31, A32, A33, A34, A35

Records with same prefix (Ai) have the same partition key but different sort keys. Assume that all the records listed above happen to belong to the same partition so that all these records will go in the same stream-shard.

Now, if I process this shard using KCL, am I guaranteed to get the above records in the same order? I know that changes to the same records appear in order in the stream, but does the order hold across records as well?

1

There are 1 answers

0
SIDDHARTH J MEHTA On

If you're using DynamoDBStreamsKinesisAdapter, then order of records per Kinesis shard is maintained.

If you're using KPL to push data to kinesis stream, it depends on what partitionKey you are choosing for Kinesis shard. If you've chosen the same partitionKey that was used in dynamoDB, all the records per shard will be in correct sequence.

I'll be able to explain it more detailed if you can elaborate on how data is being written to Kinesis shard.