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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Choosing the most appropriate data storage method

Michail
10-Marble

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?

ACCEPTED SOLUTION

Accepted Solutions
jlittle
12-Amethyst
(To:Michail)

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
jlittle
12-Amethyst
(To:Michail)

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.

Announcements


Top Tags