How are real time web applications achievable with PHP?
9th January 2011
My answer to How are real time web applications achievable with PHP? on Quora
You don’t need to build your comet server using the same technology as the rest of your site.
I build apps in Django, which isn’t really suitable for comet due to its core expectation that an HTTP request/response cycle returns immediately rather than blocking. If I was building a comet application, I’d have the main site served by Django and then run a Node.js or Twisted or Tornado server on a separate subdomain (comet.example.com) and have my comet calls served by that.
Quora does something similar to this—if you run Firebug or similar you can see that Quora’s comet servers run on subdomains with names like tch972015.tch.www.quora.com. This also makes it easy to scale your comet stuff since you can just fire up more servers on more subdomains—you don’t even need to load balance them (though you probably should). I believe they use the same Python stack for Comet and the main site, but there’s no reason you have to.
More recent articles
- My AI/LLM predictions for the next 1, 3 and 6 years, for Oxide and Friends - 10th January 2025
- Weeknotes: Starting 2025 a little slow - 4th January 2025
- I still don't think companies serve you ads based on spying through your microphone - 2nd January 2025