简体   繁体   中英

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)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM