Skip to main content
16-Pearl
November 22, 2021
Solved

How to not lose data when adding stream entries rapidly

  • November 22, 2021
  • 1 reply
  • 1826 views

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

Best answer by nmutter

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.

1 reply

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 ...

nmutter16-PearlAuthor
16-Pearl
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 😉

Support
December 7, 2021

Hi @nmutter.

 

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

 

Regards.

 

--Sharon