[gameprogrammer] Re: Design tips for directory server backend for games

  • From: Matthew Weigel <unique@xxxxxxxxxxx>
  • To: <gameprogrammer@xxxxxxxxxxxxx>
  • Date: Thu, 11 Nov 2010 11:32:12 -0600

On Thu, 11 Nov 2010 08:53:44 -0800, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:


For the back end I would use PHP.  it should work just fine.

To clarify this a bit, web applications can generally get away with "fixing" performance problems by adding more hardware - not bigger hardware, just more individual machines. The only real bottleneck with this approach is the database backend, which essentially becomes the communication medium between the servers. Google App Engine requires Python or Java, and of the two I'd probably recommend Python due to my own proclivities, but either would be fine.

You might also be interested in doing some research into "cloud
computing".

...Like Google App Engine? :-)

http://aws.amazon.com/

The advantage of GAE over AWS is that AWS requires more machine management, as I understand it. Google's offering removes a lot of those concerns: you upload your program and it runs. I know some companies that are very happy with AWS, but they also tend to have someone dedicated to monitoring/managing the virtual machine instances or writing tools to do so. Another advantage is that you're significantly more tied to GAE than AWS once you use it: you can migrate from your own servers to AWS instances, or migrate back to your own servers and all you lose is the instance management effort you did. With GAE, you'd need to create all that infrastructure if you leave them.

PS- I very much recommend starting with PHP server side for numerous
reasons, but, even though i don't really recommend it, there is
something called fast CGI where you can write c++ code for a web
server.  Of course, if you go that route, there are new dangers you
hit such as having a server that is capable of leaking memory, having
concurrency issues, being much more likely to crash, and having more
subtle issues like that.

...Because PHP doesn't leak memory or have bad security problems? :-)

More seriously, though, doing a web app in C++ will cut you off from a lot of the available libraries, and require a ton more from-scratch work. In some cases it's worth it, and it's not too bad if you're doing a SOAP-style backend interface (which, for example, a PHP/Python frontend could talk to), but I think it requires more expertise with web development.

More below in direct reply to Kevin...

On Thu, Nov 11, 2010 at 7:50 AM, Kevin Jenkins
<gameprogrammer@xxxxxxxxxx> wrote:
I'm trying to write a server directory backend for games that is pretty ambitious. I want to host it using http://code.google.com/appengine/ (Google app engine) so I don't have to pay monthly fees and can potentially scale it. I also want a web-based front end for the service so I can support multiple games, and can assign moderators to manage particular games. It
would also have an SQL database storing the list of running games.

I think Google App Engine will restrict you to using the GAE storage engine, accessed via their own query language GQL.

For the web interface, it's clear that I need a programming language of some sort. For example, I need to be able to login to the web interface as admin in order to manage the list of moderators and therefore show a different webpage based on who you are. What recommendations do you have? Is Java a server-side programming language I could use for this? Or Python? I know PHP can do it. Performance isn't too important for the web-interface, but if I can use a language close to C or C++ it would make it easier for me to write
and learn. Are there other options?

In general, "everything." It depends on how much you want to muck with the system, vs. minimizing the knowledge and code you have to have. Google App Engine lets you do the latter, as long as their other restrictions are acceptable, like what domain names you can use with HTTPS.

engine for this, or can I process everything in PHP fast enough? For
example, if I am processing thousands of requests a second, can a PHP based web host handle this? If I use java or python, would this be faster than PHP? And can I scale multiple instances of the application with google app
engine all using the same database?

They're all going to be about the same. The real trick to serving thousands of requests per second is to scale horizontally, having more machines responding (each probably only handling hundreds of requests per second). Google App Engine gives you this essentially for free.
--
 Matthew Weigel
 hacker
 unique & idempot . ent


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: