[MUD-Dev] Questions about server design

Mike Shaver shaver at mozilla.org
Tue May 7 10:46:12 CEST 2002


On Sat, May 04, 2002 at 10:11:44PM -0400, Ben Chambers wrote:

> Second question, how plausible is XML as a format for MUD data
> files as opposed to a SQL based database?  Would it be fast enough
> using the java classes to parse it to create a XML based format
> for my MUD data files instead of using SQL?  This idea appeals to
> me because it makes it easier to write object oriented data files
> that take into account inheritance and stuff, but I don't know if
> the load times would be drastically reduced.

The first thing I think of when I read that question is that there's
a bit of an mis-step in comparing the two mechanisms directly.

SQL-based systems are both query/retrieval systems and a storage
system optimized for such queries.  The query language is designed
for reasonable efficiency and reasonable human-friendliness.  The
storage system isn't intended to be altered by anything but the
purpose-built tools provided with the DBMS.

XML is just a storage system/format.  (There are some adjuncts like
XSL:T and XPath for performing queryish things, but that's certainly
not the focus, and it shows.)  The storage format is designed to be
human-editable and relatively efficient to parse, but makes
basically zero concessions to efficiency of manipulation.

I think XML is a fine system to use for data files, and the growing
number of tools for manipulating (transforming, verifying,
generating, etc.) XML data is a nice base to work from.  But the
naive (though apparently not uncommon) approach of just reflecting
the XML structure or DOM in memory for runtime access will hurt you
_badly_.  I think a good approach might well be to use XML as the
"preferred form of modification", and then populate your
query/manipulation structures from that basis at startup or
zone-load time.  Those structures might be a SQL database, or some
custom in-memory format, whatever meets your needs best (where
"needs" probably includes "available development time").

(shren has, correctly IMO, pointed out that there's a difference
between "designed for" and "good at", which is why I'm more
confident about XML than about XPath for this sort of thing; it's
had a lot more "bake time" solving real-world problems.)

Of course, I've never built a MUD, so I'd love to hear counterpoints
from more experienced folk.

Mike

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list