0

I have a DynamoDB table where I enabled DynamoDB stream. I also have a trigger which invokes Lambda function when item is changed.

Is there any millisecond-precise timestamp field in DynamoDB stream I can rely on?

I'd like to rely on it in downstream services which are sensitive to the order of messages.

Patrik Mihalčin
  • 3,341
  • 7
  • 33
  • 68

1 Answers1

0

As you probably already know, the ApproximateCreationDateTime on the stream is, as its name suggests, not all that accurate. If you need order I would use the SequenceNumber, which is in order. If you must have a timestamp you'll have to include it in your data, but be aware that the time you create the timestamp in your data is not the same as when the data is added to the table. In many cases that's fine, but if you have more than one process writing you could have process A created a timestamp that is before process B, but the data from B could be written to the table before the data from A.

Jason Wadsworth
  • 8,059
  • 19
  • 32