Saving data in MMO

1.7k views Asked by At

What are your thought about saving data (such as character stats, achivements, items) on a MMO game? Clearly you want as little dataloss as possible if(when) the server goes down for some reason.

  • Saving the character whenever something important has happend? Seems jumpy, performancewise?
  • Saving everything once very X Hours? Causes a few seconds freeze, but could be accompanied with a nice "The world is saving"-message.
  • Maybe having a save-timer for every character, where you queue the character for saving every once in a while, and the server works on this queue whenever it is not busy?

Out of these three i think the last one is a pretty good solution, but i might have overlooked something. But what are your thoughts, how are the "big boys" doing it?

4

There are 4 answers

1
Michael Borgwardt On BEST ANSWER

Saving the character whenever something important has happend? Seems jumpy, performancewise?

Not in the least. Compared to everything else that has to be done for such a game, this is utterly trivial. Any decent database engine will handle that. That's what they're built to do.

0
nmichaels On

I would use a write-through cache for my database. Most aspects of a character don't change very often. Those that do, like position, already require some pretty heavy engineering to keep coherent across servers and clients.

0
marrat On

maybe make a sort of cache server. game server would send read/write requests to cache server, cache server would write/read stuff from db and send back to game server. this way if certain query gets laggy it wont stop thread in gameserver, if server goes down - cahe server will still have cached data and save it if not saved already.

0
Robert Basler On

I wrote this http://onemanmmo.com/?doubleentry while solving how to record microtransactions and guarantee they survive a server crash for my game. The article is on using a double-entry accounting database schema on top of MySQL with some info on stored procedures and security.