I use several options depending on things like priority and importance. My MySQL database receives many inputs from sensors and devices around the property. Then I use one of two methods to have the server respond.
One is to have a cron job which looks at changes to the database and responds accordingly. Another is a trigger within MySQL. I also use a text messenger service to achieve a similar result.
Before we go further, which of those seems the most appropriate?
It depends on whether you need urgent indication (an alarm condition) or just advice something happened, or interesting but not urgent.
For my perimeter control (say people opening my gate) I use text to my phone. For non urgent indicators, I use cron jobs that check in every so often, for information only (temperature, wind etc, I use a web page updated from the database.
It depends on what you need to do.