Redis sub/pub and php/nodejs

Viewed 9837

Starting to work on a new project using redis as a sub/pub system to display results from a mysql db. So if there are updates I wanted to publish those updates from mysql to my web page. My question is, which option would be better?

Option 1: Should I just do all of that via nodejs and socket.io? Meaning creating a nodejs script that connects to redis, subscribe to the channels I need to listen to, using mysql in nodejs query the db for updates, if updates publish the mysql rows then in the html that is connecting to nodejs via socket.io get the new data and process it to display the results?

Option 2: Have a php script query mysql and with redis-php client publish any updates to the channel? Dont know exactly what else needs to be setup from here. Do I still need to have nodejs involved in this option?

Or am I just off based on how all this works? The bottom line is I want to display results via mysql database to the user using redis sub/pub capabilities.

1 Answers
Related