Re: Database use in CircleMUD (was Re: [Code] Native Database Driver)Support

From: Daniel Burke (addictmud@home.com)
Date: 04/02/99


On Fri, 2 Apr 1999, Anil Mahajan wrote:

I have to take issue with some of the stuff mentioned below.

> On Fri, 2 Apr 1999 12:03:17 -0500, Michael Lemler <coronach@succubus.datacruz.com> wrote:
>
>    On the note of speed and ODBC.  Many people will be surprised by how
> _slow_ databases are when linked into the MUD.  I almost scrapped all
> of my work when I had just put in my database code.

We've used MySQL for 6 months or so now, and speed so far hasn't been an
issue.  Granted, I am very careful what gets used in the database, and test
speed concerns a lot, but overall I'm happy.

>    The MUD works in .1 second increments.  That's not much time to transmit
> data to and from a database, espetially if you do this as they are currently
> done (in mass every few minutes).  It's also slow if you do things instantly,
> as I do things now.
>    The way i sped things up is to create 2 database controlled threads
> and have those threads do all update/delete/insert statements.  This is
> good because it's fast and transparent.  It does prevent you from catching
> errors in your functions that do the SQL.
>    As for select statements, I had to do some other crazy stuff with
> threading.
>    It's doable, but you've gotta do a lot to make it transparent.

Probably the first thing I did when I started using MySQL was 'clan'
information.  All information about what rank you are, the name of your
rank, down to simply what clan you are in, or clan treasury, etc, etc, it's
all in a set of tables.  When you type WHO, your clan is listed next to your
title in pretty green <<Clanname>>.  I take issue with the comment about
speed, and having to split everything up.  I just typed WHO, and there's 26
people on at the time I write this, 7 of them are in clans.  Since no clan
info is stored in game or on any character, the who list just made 26 hits
to the database to see if each person is in a clan, it found at least those
7, if then checked those seven for rank, to see if they are an applicant
(applicants don't get their clan name in the who list), so that's at least
33 hits just to see if you ARE a full clan member, then another 7 hits to
get everyone's clan name.

Is that excessive and wasteful?  Probably.  Is it slow? not hardly.  A who
list doesn't take any noticably longer amount of time then it would if it
didn't touch the database at all.

These days we store an aweful lot in the database, and only use 1 thread, no
special fancy handling.  We open one connection to the database, and leave
it open.  If something happens to that connection the mud reboots to re-open
it, but that's only ever happened once.

Maybe it's the database we're using.  MySQL is lacking in some of the
ability of many other database packages out there (I know I'd love to use
triggers and procs, they're terribly handy), but it could be that that makes
it much faster then others if speed truly is a problem for some.

But my point is, such measures are not necessary unless you are planning on
storing EVERYTHING in an sql database, and even so, if you're storing world
files like that, I don't understand what the big deal people have about muds
that take a few seconds longer to boot.  Way I see it, speed on bootup isn't
a concern unless it seriously does take a while, you should be more
concerned with the speed of operation... but I digress again.
(just as long as you don't try and use an ODBC connection to an Access
database, talk about slow twice over *gag*)


Brazil - AddictMUD
game.addictmud.org 4000
http://www.addictmud.org


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST