Tuesday 31 March 2020

Notifications system using PHP + Socket.io + MySQL

So, I'm looking to implement a notifications system, as well as chat messaging later on into an existing project where the technologies used cannot be changed (as we're quite a bit into development). This is a newbie question as I started looking into this functionality just yesterday.MySQL database contains a table called notifications which gets updated in certain functions in the php controller. I add an entity, other users get notified of it.I've thought about a few approaches:First one I've thought about is listening to the changes of the mysql 'notifications' table... Is this possible? A few online posts say that listen/notify is not possible with mysql. This would be my preferred way of doing this since it seems the easiest and the least complex.The controller function inside php sends data to the node socket and everything gets updated immediately. However, I'm using php phalcon, and I haven't figured out a way yet to do this. I reckon there's an universal php implementation for this maybe, but I haven't found it.Also, I'm open to using something other than socket.io if it gets things done in an optimal way.I'd appreciate help if anyone has run into the same problem! :) Cheers

Submitted March 31, 2020 at 12:13PM by bringmeteaorcoffee

No comments:

Post a Comment