Attaching an event to MySQL from Node.js (or another)

I am developing an application that will run in a browser and warnings will be hung on it. I have already decided that to handle the mass of connections and all the so-called reverse AJAX parts of it with Node.js and Socket.io. It looks great to avoid constant polling and give me an application in real time, except for one, how can I get information from mysql database in real time?

I present something like an event handler in which I can say something like a line inserted, give me data. I know that this can be done using triggers, but not for this.

Is there a good way to do this?

PS If I need to use something other than Node.js, then this is not a problem.

Thanks,

Gareth

+4
source share
1 answer

What if you try to use the sys_exec (), UDF functions? you can reach node.js via mysql triggers and some external script ..

- The mysql trigger runs a script (php or perl or something else) that contains your javascript node clients.

Greetings

+1
source

Source: https://habr.com/ru/post/1394192/


All Articles