[MUD-Dev] Database vs. Disk

Daniel.Harman at barclayscapital.com Daniel.Harman at barclayscapital.com
Mon May 19 10:21:32 New Zealand Standard Time 2003

From: Tom [mailto:tom at interspaces.com] 

> We're considering moving to database because it'd provide us alot
> of extra versatility, but I'd like some informed opinions. Not so
> much whether a SQL database would be more efficient, but would it
> be drastically inefficient on a MUD with a large number of objects
> (500,000 to 2,000,000)?
> I know it depends on many factors, let's assume a mySQL database
> without alot of bells and whistles on the DB end (stored
> procedures, etc.).

It depends a bit on how you manager your persistence. Using a
database, you pretty much need to throttle the writes of objects to
disk if you want to maintain any sort of performance. This is
obviously totally dependant on how much your MUD reads/writes and
the TPC of you database. If your mud already has an object cache,
then it might not be too hard to spin off a thread that persists
dirty objects every few mins depending on their priority. You don't
really want to be accessing the database synchronously if
scaleability and latency are an issue.

I've not had any experience with mySQL, but the lack of sprocs
definitely prejudices me against it. On a typical database you lose
a lot of performance if you don't use sprocs since the query planner
can precompile them. It's also a decent way of enforcing an
interface based approach to the database, so that if you do spot
mistakes in how you try to access the DB, you can at least work on
the sprocs causing the problem. If however your code is sprinkled
with dynamic SQL statements, you are in a world of pain, especially
if you have people who don't know a great deal about databases
writing them.

However you approach it, you will have to look at how your structure
the database. The following link gives some idea of what you need to
consider :


N.B. You will need to be a member of gamasutra to read it I believe.

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

More information about the MUD-Dev mailing list