Currently I’m developing a web app for online collaboration. One of the key features is real-time responsiveness - i.e. when someone posts something, others get the new post instantly.
I do not consider old-school stuff like setting timeout on a client. At the moment I think that socket.io is pretty much what I need. But I have a doubt whether the tandem "php+socket.io" is viable. For example, how do I make them communicate with each other? How do they share the auth session?
Does anybody have experience in this field? Your experience is very valuable to me.
Honestly, can’t tell you exactly because we haven’t opportunity to run with highload yet. But I assume we wouldn’t have any problems with ~100 connections (or maybe even with 1k, because node.js + redis is very fast).
Also please note, that you could easy to scale node.js application by just copping to another node. Redis also is fast & scalable engine. So I don’t think that any deadlock issues will come. But this technology is still “beta” and no guaranties here.
We no need to use proxy, so we connect directly to nodejs (we use 3001 port for this). Also nodejs didn’t call any php code (for example, through fastcgi) and so on. To keep it fast as possible.
Many thanks for answers! You really clarified things.
As for proxying nodejs - I’ve heard that it is recommended to proxy nodejs by a stable web server (nginx for example) for security reasons. Have no proofs though.
I’m planning on building a small web server using nginx and node js, since I need it for building a real-time web application (with Yii, of course), as soon as my dedicated computer arrives.
I was thinking of nginx to process php and nodejs to send database queries and updates.
I will post my development results and experiences here, when I get them