Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   MUD Storage Options (http://www.topmudsites.com/forums/showthread.php?t=327)

Vopisk 03-25-2005 04:11 AM

So let's see, where to begin my first post...

I've recently begun studying C++ and taking peeks at other languages and stuff doing my best to teach myself with what's available on the web because I'd like to do MUD coding somewhere down the road, I've downloaded a few codebases to look over as examples while I'm learning so I can understand the basic structure and what have you. Anyway, I've heard a lot of noise about the various types of storage and what not and I figured I'd pose the questions I'm having here to see if I can get some answers.

I understand the different SQLs because pretty much every language page has tutorials in regards to them, but I've also heard talk of using flatfiles for storage and don't really understand what they are, how they work and more specifically how they work in a MUD environment. If anyone can do me the favor of explaining a bit or pointing to a tutorial or the like somewhere I'd appreciate it.

Also, in addition to a clarification of how flatfiles work, if someone could give a (hopefully) un-biased break down of the strengths and weaknesses of any sort of data-storing system, it would be much appreciated.

Anyway, without further ado, the end of the post!
Vopisk

eiz 03-25-2005 07:43 AM

"Flat file" is generally used to refer to sequential, plain text storage. It's not a bad choice if your data set is small enough to fit in memory and you use some sort of rational encoding (e.g. xml, s-exps, yaml).

With that said, my storage method of choice for a MUD is an object-oriented database. Some MUD codebases are specifically designed around this (e.g. ColdC), but odds are there is an OODBMS available in your language of choice. Most C++ OODBMSes are commercial products, although there is GOODS and Brian Lindahl's upcoming MudDB, which may actually be completed sometime in this century. However, if you're flexible on language choice you have some options. In particular, I'm thinking of the .

Basically, how it works is you make classes that inherit persistent.Persistent. Then you simply make sure these objects are reachable from a 'root object'. ZODB then handles persistence and caching transparently. You just begin a transaction, modify your objects, and commit. For indexing, you create a persistent btree object (OOBTree) and stick your objects in it. It's probably the simplest possible way to store some data.


All times are GMT -4. The time now is 02:27 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022