Skip to main content
17-Peridot
November 22, 2021
Solved

How to not lose data when adding stream entries rapidly

It's an old question but "In PostgreSQL and H2, stream entries are keyed by the unique key entries of the timestamp and source." - https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Composer/DataStorage/Streams.html

If you use another persistence provide you seem to be out of luck "The timestamp is a key field for streams. If you add an entry with the same timestamp, it will overwrite the previous timestamp (upsert). To avoid overwriting, specify milliseconds for the timestamp." - same source

nmutterAnswer
17-Peridot
December 7, 2021

Hey @slangley ,

yes, but only for "PostgreSQL and H2" referencing the docs. I did already mention it in the 'first' post. The thread was recreated as I added it to an older conversation.. But thank you for mentioning it again, better once to often.

 

I will close the thread with solution -> please check my initial post.

4 replies

22-Sapphire I
November 29, 2021

Also entries must be 3 miliseconds or more apart I believe, not sure if this is outdated knowledge from my brain ...

Translate
nmutter17-PeridotAuthor
17-Peridot
November 30, 2021

Just got an Support Article update stating

"The minimal timestamp unit to differentiate Stream and Value Stream entries is 1 millisecond" - https://www.ptc.com/en/support/article/CS340193?source=subscription

So it seems you can discard this information you had from your brain 😉 Space for new facts! Yeah 😉

Translate
Support
December 7, 2021

Hi @nmutter.

 

It's worth mentioning that source is also considered for determining whether the update is unique.

 

Regards.

 

--Sharon

Translate