I am working on a project that's developed with the CodeIgniter framework. My project has a lot of user interaction like posts, comments, and other notifications that should be live.
I have tried by now to get those notifications in two ways:
1. I've tried to build a sort of data pull system with AJAX but in my opinion this was making lots of bandwidth waste on my server
2. I've set up a node.js with socket.io server, that only listens for some socket events and pushes the notifications back to the user. For example, when a comment is added, instead having a function that pulls all the new comments from 5 to 5 seconds, I'm having a socket.emit(); that pushes the comment information to node.js and node.js pushes the notification to all connected sockets.
I am not sure if node.js + PHP is a good job ( but, what I've learnt so far is that node.js is good for long polling and less resource costs ).
Witch architecture would you consider is better?