Listening to database for update events


I am new to the yii2 framework, well I have 1 project behind me. Nvm…

I have been tasked to develop a security monitoring app. The app will be connected to many RasberryPi terminals which will have a button to trigger an alarm. I do not know almost anything about raspberrypi or how this server clients are actually communicating.

My questions are:

  1. Should I approach this by listening to database updates (every camera and terminal have boolean alarm entry/row), so when the app notices an update in this row , it should display it in the app. For such a way I did not find any information for Yii2 documentation…could anyone say which language I should use for this AJAX,PHP, or which?

  2. Or should I approach by writting an SQL trigger…but I also did not find much usefull information on the subject.

  3. Should the raspberrypi run a method of notification the app of the update being made?

I might be just really off…please suggest me something :)

Thank you!

I would do something different. You mentioned / implied that the data is being logged to a sql database - I would let the database keep the audit records and use a different technology for the notifications such as SMS (texting) or better yet, push notifications.

There are a number of different solutions out there for sending notifications upon an event happening. You use an established system like pubnub which handles the backend stuff for you, or you could roll your own solution with a message queue or even redis.

When the button is pushed, what is supposed to happen? Email sent out? Text message? Push notification to a phone?

Lots of info out there.

This one is really cool. Uses a button and videocamera, sends the notice plus a picture of the door ringer.

Expect to learn some python if you don’t already know it…