Could you recommend a lightweight database?

Started by
18 comments, last by Acar 7 years, 7 months ago

About the actual question, does that huge amount of data have to be saved so often anyway? Items change slots maybe a few dozen times during an entire game session, and they change owner only rarely. Why not write trades to a local journal just to be sure you can recover, and coalesce all item updates once per minute (or less often, even!) to the database.


Similarly, all player stats can easily be held in RAM only, important things logged to a journal just in case, and regularly flushed. If your server crashes so often that this may be an issue, you habe a different problem to look after! And otherwise, if this happens maybe once every other month, no user will be angry if they get restored to full health and full mana upon a crash... as long as they don't lose the Sword of Almighty that they just won a minute earlier (...which the journal prevents from happening to the best of your ability).

Not necessarily. I believe solutions suggested by many people(keeping everything on memory, dumping to a file on certain intervals and commiting critical updates on instant) will be what I go for.

Appreciate all the answers. Played a bit with the 'keep everything on memory' approach today and was quite happy with the results. Might need to invest some time into writing some utility functions but I feel like it's well worth the effort considering how much simpler things got.

This topic is closed to new replies.

Advertisement