Persistant storage.... My current idea.

Ben Greear greear at cyberhighway.net
Sat Mar 28 22:34:54 CET 1998


Well, there was a lot of good information come out of that
discussion.

First my criteria:  I'm using java, and don't want to deal with
external software (read DB's) if at all possible.

I want simple transport/backup of the persistant world.  (read few or one
file).

I'm going to go kinda simple, but code OO so that it should be easy
enough to swap it out later.

*********************

I'm currently planning on using one file, with certain blocks
allocated within it for objects.  It will basically be a linked
list represented as a file.

I'll have headers that point the the seek position of the next and
previous element in the file.  It will also keep track of the used and
total space allocated for that element.

If I need to update, and it's too big, it will be moved to the end
of the file, and the previous element will get it's space.  (I'll deal
with boundary cases, sufice it to say.)

Now, this reeks of inneficiency when trying to look up an object based on
some key (object number in my case, probably 8 bytes ).

However, I'm going to create a hash table at boot time to link an object
id with the seek position of that object in the file.  I believe this
should give me as quick access as I can expect.

*************************

Some other things:  I'll have objects unique across the universe, even
different servers.  (Each server will be assigned an ID, and each object
within that server will have a unique ID.  So, given both ID's, I can
guarantee uniqueness.)

I don't see more than 100 or so servers collaborating at a time, so the
host lookup tables will be as in the early internet:  You have to modify
them by hand...none of this DNS stuff :)

But imagine all the fun of figuring out currency exchanges and whatnot?
What if some admin makes his server a power server, and others go for
a minimal approach...what to do??  Whoa, need to think about this.

Maybe I won't let them....

*******************************


Now I just have to figure out how I'm going to do the grapics part :)

When I know enough to ask a decent question, I'll let you know!

PS.  I hope the fact that the last message I saw was about a change
in the mailing list software isn't a bad sign!!

aka Grock

Ben Greear (greear at cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html




More information about the mud-dev-archive mailing list