cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Choosing the most appropriate data storage method

Michail
9-Granite

Choosing the most appropriate data storage method

Hello all,

I'm implementing alarm handling mechanism which should closely resemble that of alerts (Alert History). However, I stumbled upon a problem associated with a stream. Say I have an array of certain entries which I have to put into a stream. If I loop through that list and run "AddStreamEntry" service with each iteration, in the end I'll see only a single (last) entry. I found an explanation to this in ThingWorx documentation - if a new record has the same timestamp as that of the previous (within 1ms) , the previous entry will be overwritten.

*

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.

Does it mean that if two alerts will get acknowledged within 1 ms only 1 record will be made in AlertHistory stream?

1 ACCEPTED SOLUTION

Accepted Solutions

You are correct.  If you have two alerts that triggered at the exact same instant (down to the same millisecond), you will only ever have one entry appearing in the stream.  The entry added last will always overwrite the contents of the earlier entry.

View solution in original post

1 REPLY 1

You are correct.  If you have two alerts that triggered at the exact same instant (down to the same millisecond), you will only ever have one entry appearing in the stream.  The entry added last will always overwrite the contents of the earlier entry.

Top Tags