1
votes

I'm preparing proof of concept for azure iot . I send data from device a to azure iot hub and from iot hub sending data to database via stream analytics.

Question is : I want to check if I have this record in database if not I want to add record. And I want to create "start time" when some certain event occurred and "finish time" event is finished so I need to update row. Is it possible with stream analytics and is stream analytics correct place to do this kind of checks ?

2
how many messages are we talking about per second. And of what size and format? Also, what database will it go to? - Peter Bons
max 2-3 messages per second.im posting as json format. it will go to azure sql database. Thank you. - Cozdemir

2 Answers

1
votes

If you want to be sure to only add one record in the database, you can follow the instructions on our team blog: https://blogs.msdn.microsoft.com/streamanalytics/2017/01/13/how-to-achieve-exactly-once-delivery-for-sql-output/

Thanks, JS - Azure Stream Analytics

0
votes

actually Im not Sure but hope its helps.

U cannot update your database.

Azure Stream Analytics is works for stream your data.

I think you have a 2 option for this case

One way you can keep your data on temptable on stream analytics you can check your conditions and insert database but its not work with older datas

second way u can use trigger on your database.

CREATE TRIGGER TriggerDataFromStream
ON DataFromStream
AFTER INSERT
AS 

Like this.