Technologies for online games with low response time.

I wonder what technologies are used to achieve the lowest possible response for multiplayer games in a web browser? What kind of database to use? Is SQLite a good option? In terms of language, I’m more interested in php (although, I understand it is far from the fastest for cgi), but I’ll be happy to listen to other options. And are there any interesting articles on this subject?

Answer 1, authority 100%

This is not the problem in the database, sockets are used for the fastest possible response…
It is for games – I recommend java or nodejs (I would choose the latter myself because you will win in the speed of development despite the “risk” of using the new technology)

I myself recently became very interested in similar issues, I understood one thing (I understood the truth before 🙂 ) for sure – the database is not so important, the server is important (I mean the server code)…

As for php – in this case, really IMHO, to put it mildly, not the best option …

Small client and server example using nodejs +
It is logical that in order for all this to work, you need to install nodejs + download, Google will help everyone with this, I’ll just give an example…


 * require  ,    linux'e 
 *   ,        
var io = require('').listen(8010, '');
//       -     
//   8010   c IP
io.sockets.on('connection', function (socket) {
    //    - socket
    //  ...
    socket.on('message', function (msg) {
    socket.on('disconnect', function() {
        console.log("User disconnected");


First of all, we need to connect a script that will work on connecting and resolving cross-browser compatibility problems, i.e. if the browser supports WebSocket, they will be used, if not, then it tries to create xhr, long puling, etc. etc. In principle, you don’t need to really delve into what and how, just create a connection …
It’s done like this

   <script src=""></script>

I think everything is clear here…

And our “main” script…

var socket;    //     
var msg=0;     //    
onload = function() {
    socket = io.connect(''); // 
    //      ...
    socket.on('connect', function () {
        setInterval("socket.send('  - ' + msg); msg++;", 1000);
        //       c     ...

Well, actually, all that remains now is to start our server and see the result 🙂
As you can see, everything is paradoxically simple…

PS: after I wrote something like this for the first time, I immediately fell in love with nodejs ^^
PPS: testing in mazil, opera, chronium, chrome – no problems were found, if the browser does not have a WebSocket implementation, dances with a tambourine are used in the client script, it might even work in IE (although if the question is about the game, I don’t think that it makes sense to somehow try to write a client for IE)

UPD2 wiki
Off site