17

Is there any way to get the timestamp for the most recent update on a DynamoDB table?

1

2 Answers 2

41

No. This is not part of the DynamoDB api. Fortunately this is easy to implement yourself. Add a column to each item for each UpdateItem or PutItem request with the current time. This will insert the time according to your application servers instead of DynamoDB itself, but these ideally will be the same

4
  • 5
    But there is no guarantee that the clocks of all application servers will be in sync. Jan 27, 2015 at 17:23
  • 6
    Of course not, synced clocks are a fundamental problem of distributed system design. Unfortunately, @Ajax did not speak more about his usecase so we cannot begin to guess the implications have in his system. I simply addressed his question as asked. Jan 28, 2015 at 20:44
  • 1
    Not sure why this was downvoted. The answer is 100% true. The alternative offered isn't perfect, but it's the best you can do given the constraints of ddb.
    – scosman
    Jul 29, 2015 at 23:32
  • what if the item deleted from table? how do you update the time?
    – CCCC
    Jul 9, 2021 at 3:58
0

If you are just interested in an approximate time, you can get the timestamp of the write operations rounded to the nearest 5 minutes by looking at the SuccessfulRequestLatency metric for the PutItem operation inside Cloudwatch. You will see an entry on the x-axis only if there was a write operation in that 5-minutes time segment.

In the following screenshot, you can see that there was at least one write operation around 10:30 and 10:35, too: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.