Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequence numbers in dyamodb streams

I have a stream enabled dynamodb table. A lambda function consumes this stream. Each record in the dynamodb stream has a SequenceNumber assigned to it. What is its significance?

Lets say that record1 entered the stream before record2. Does it mean that SequenceNumber(record1) < SequenceNumber(record2) ?

like image 443
mightyMouse Avatar asked Oct 18 '25 19:10

mightyMouse


1 Answers

The meaning of Sequence Number is explained in docs:

Each data record has a sequence number that is unique per partition-key within its shard. Kinesis Data Streams assigns the sequence number after you write to the stream with client.putRecords or client.putRecord. Sequence numbers for the same partition key generally increase over time. The longer the time period between write requests, the larger the sequence numbers become.

For your question, it depends on the partition. If its same partition, it will increase. But if you put records in different partitions, they may not preserve the order.

like image 168
Marcin Avatar answered Oct 20 '25 08:10

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!