Can I update the records data in AWS timestream? From what I have read, delete & update operations are not permitted in timestream. Is there any workarounds to perform the update operation on the timestream records?
Asked
Active
Viewed 2,137 times
1
-
1You can upsert data in AWS Timestream https://docs.aws.amazon.com/timestream/latest/developerguide/writes.html#writes.writing-data-inserts-upserts but you can't delete records. This means that you can modify the *Measure* value of your record but not he *Dimensions* since they are part of the primary key identifying your unique record – MaFF Jan 12 '22 at 12:56
1 Answers
2
As long as all dimensions and the timestamps are the same, if call the method .version() with a number higher than the one in storage, (like version = 1 on db and update with .version(2)), yes, it's possible to update. Please, refer to the article linked in the comments of MaFF. (https://docs.aws.amazon.com/timestream/latest/developerguide/writes.html#writes.writing-data-inserts-upserts)

Eduardo Elias Saléh
- 806
- 1
- 11
- 23
-
1To clarify, the version is a parameter on the Record sent to the write API but it's not a measure value (column) that you need to model. See the Timestream API docs for a Record which defines the version parameter, https://docs.aws.amazon.com/timestream/latest/developerguide/API_Record.html. One trick they show in their samples is to use the epoch seconds as the version to ensure later writes always upsert. – Nadir Sidi Feb 08 '22 at 20:35
-
@NadirSidi I have posted a question, please take a look at it, it doesnt work for me: https://stackoverflow.com/questions/72088242/how-should-i-update-a-field-of-a-record-in-amazon-timestream – showtime May 02 '22 at 14:35