node.js - Pros and cons of different ways of adding a real-time multiplayer game to a website on PHP -


background

the website has classic lamp setup , runs on virtual private server. aim add html5 multiplayer game runs on same domain, has latency of 500ms, maintains state on server side , can support few thousand concurrent games 2-5 players per game @ peak times.

since had little experience php , server side in general, original plan write game demo in node.js+socket.io , rewrite in php later on. however, i've written demo (~400 lines of code on server side) have doubts plan. there 2 ways of integration considering:

write game in php

pros:

  • fewer changes original setup
  • not having split server side 2 parts in terms of languages, templates etc.

cons:

  • lack of popular solutions real time communications in php
  • scalability concerns

run node.js , php servers in parallel

since site hosted on vps, think can put nginx in front of apache , node.js client have use single port on single domain.

pros:

  • ability use socket.io real-time communication client
  • if game server goes down, rest of site still work

cons:

  • complicating setup adding web server , reverse proxy

question

as said, have little experience server side, although making demo helped lot. there better ways of doing this? did miss out important pros/cons? points important in practice?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -