dynamodb 流中的序列号

Sequence numbers in dyamodb streams

我有一个启用流的 dynamodb table。 lambda 函数使用此流。 dynamodb 流中的每条记录都分配有一个 SequenceNumber。它有什么意义?

假设 record1 在 record2 之前进入流。是不是意味着 序列号(记录 1)< 序列号(记录 2)?

Sequence Number的含义在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.

对于你的问题,这取决于分区。如果它是同一个分区,它会增加。但是如果你把记录放在不同的分区中,它们可能不会保留顺序。