[MUD-Dev] Re: Databases: was Re: skill system

Adam J. Thornton adam at phoenix.Princeton.EDU
Sat Jun 20 09:37:33 CEST 1998


On Sat, Jun 20, 1998 at 04:17:25AM +0000, Jon A. Lambert wrote:
> An OO DB might be more attractive than an RDB.  Since a whole host 
> of OO comes for free.  Yet your mud programming language's particular
> implementation of OO might have to match or be translated to a form
> recognizable by the OO DB.

I'm using PostgreSQL in the project I'm working on.  I have no idea whether
the speed will eventually be acceptable or not, yet.

My objects are runtime-static in the sense that new object properties and
methods will not be created on the fly.

Postgres works rather nicely for this since you can define tables/classes
in an inheritance relationship, so that class Item can inherit Object but
add the properties Legal_Owner, Parent_Object, and Container_Relationship,
for instance.  Then items with weight and bulk can inherit item and add
weight and bulk properties.  You can do multiple inheritance, too, so I can
have an item class that inherits both Bulky_Item and Container, to get,
say, an orange crate.  Or those two plus Lockable for a chest.

Clearly database manipulation gets very time-expensive.  My strategy,
although it's not completely thought through yet is to maintain much of the
world state in in-memory data structures and only commit it to the DB when
a) there's a lull and my system load is low enough that I can do so
without fear of vastly slowing down things, or b) when something that it's
crucial that the rest of the world know about happens (figuring out the
criteria for this is the tricky part), or c) when a timeout happens such
that the DB hasn't been written in X seconds, so that I don't end up with
an impossibly huge transaction queue.

This is all still very nascent, so it's all subject to change a lot.

Adam
--
adam at princeton.edu 
"There's a border to somewhere waiting, and a tank full of time." - J. Steinman




More information about the mud-dev-archive mailing list