Best way to keep the page connection on?

I'm working on a website with PHP and JQuery.

I want to update the page content automatically if there is new data grabbed from the database.

I tried doing this with JQuery and the only way is ajax polling, which requires me to set an interval to call the page every once in a while.

I also read I could use the Ratchet PHP WebSocket or node.js

I don't want to use ajax polling because a lot of data has to be grabbed from the database for each user. I also don't know how Ratchet or node.js works and which one would be best and the easiest.

Is there any other way this could be done and which one should I go for?

Peace

If you haven't done messaging before there will be a bit of a learning curve no matter which technology you go with (just a heads up). A single long-lived application will always be running where you will handle all connected clients. This is very different from your standard website where each connection lives inside its own server side script and exits on completion.

If PHP is your most comfortable language Ratchet will probably be the easier for you to pick up, as it's entirely PHP. However, being PHP, it may max out at around 5000 simultaneously connected users. Other language have higher limits.

Another paradigm to consider is you probably don't want to constantly read from your database for changes. Rather, when something happens, I'll assume a user does something and writes to the database, as that happens you will also push that same data to the connected clients.