Skip to main content
Nov 22, 2021 9:08 PM UTC
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
Dec 7, 2021 8:11 PM UTC

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

Nov 29, 2021 3:04 PM UTC

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

nmutterAuthor
Nov 30, 2021 10:09 AM UTC

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 😉

Dec 7, 2021 8:02 PM UTC

Hi @nmutter.

 

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

 

Regards.

 

--Sharon