samedi 18 avril 2015

live game, use memory or DB or both?

Currenty i'm working on creating a chess app with nodejs & socket.io


now the running games information are stored in an array like this:



games[token] = {
'creator': socket,
'players': [],
'interval': null,
'timeout': timeout,
'FEN' : '',
'PGN' : ''
};


The question is : Is better to save games info to DB at the creation of games and change the values of fields move by move, or save every game after finish? Which is better approach?


Aucun commentaire:

Enregistrer un commentaire