[MUD-Dev] Database vs. Disk

Zach Collins {Siege} zcollins at seidata.com
Sat May 24 06:03:44 New Zealand Standard Time 2003

On Fri, 23 May 2003, J C Lawrence wrote:
> On Thu, 22 May 2003 16:06:37 -0400 (EDT)
> Zach Collins <(Siege)" <zcollins at seidata.com>> wrote:

>> I believe a number of interpreted languages offer object
>> serialization - Python and Java at the very least...

> cf ZODB for the Python world.

Actually, I was thinking of the Pickle and cPickle modules.  I
haven't seen Zope's DB code, but at a quick guess, it probably
pickles any object which isn't a simple data type.

>   Given: ObjectA contains a pointer to ObjectB, a reference to
>   ObjectC, and an attribute of ObjectD, and inherits from ObjectX
>   and ObjectY, each of which potentially have their own variously
>   complex multiple inheritance trees.

> When I serialise ObjectA, how much do I have to serialise? For
> that choice, how do I guarantee logical consistency across the DB
> for crash-recovery or rollbacks or even simple updates to objects
> which are commonly inherited from or otherwise referenced?

My (inexperienced) answer: Design a simpler data structure.  The
game objects in my project have to be written out as XML for
exchanging data between upgrades or systems, because different
versions of Python serialize some objects incompatibly and because
different implementations of DBM may be used on various systems.
Therefore, I cannot afford to write out the inner contents of
functions and classes.  Since hashtables and arrays are intrinsic to
Python, and map quite nicely to a clean XML structure, I decided to
use them as much as possible to represent my objects.


MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list