I've had an idea for an online game for quite a while now and wanted to start working on it. it works on the client/server model with users logging in and being able to chat and mesage each other etc. They can then challenge eachother to a game which is RPG based. The client code is not really a problem but the server software, I'm sure I could do it, but I want to get it right, not just working.
I've decided I'm going to use mysql and the C mysql API for fast data retrieval rather than flat file which would probably be more work anyway. The problem (issue really) I have is deciding which data to hold in the database and which to hold in variables. My question is this really....
Is it good practice to hold session specific data in the database or should it just be held in memory (variable of some type)?
To explain it a bit more...Obviously data like account information, scores, league tables, items, and the like should be stored in the database, but what about a health of a player in a particular game which is going on? This would change often and would be dumped when the match ended (typically only a few minutes per match). Would this be a candidate for database data? My guess is that short lived data that changes often would probably be a candidate for server memory, but I'd really like to ask other people's opinion.
I really don't know....
What's everyone think? Any help greatly appreciated.