Database Parser design

From: George Greer (
Date: 05/21/99

Here's what I currently envision for a new database parser.  Abstract
objects and plenty of hiding.  Little internals known, big flexibility, and
much re-use.  Comments welcome, it's a pretty large system to start
immediately and includes large amounts of dependencies.  This is a scratch
design from my previous work.

Current modules planned:

DIO - Data I/O
        Basically, "open this, read that, close it", nothing fancy.  You
        get what you asked for in one big clump.  Keeps things simple.
 1) dio_mmap            mmap()
 2) dio_fread           malloc()+fread()
 3) dio_sql [DBD]       Use SQL queries to retrieve information.

DFP - Data Format Parser
        Translates what it gets from the data I/O into something usuable by
        the database world.
 1) dfp_circle  CircleMUD format files.
 2) dfp_mudpp   Some other world format (mud++ is this example)

DBD - Database Driver
        Basically an SQL language to SQL client convertor.  The dio_sql and
        dbw_sql would form all the queries.
 1) dbd_mysql   MySQL client.
 2) dbd_odbc    ODBC client (if I can get an ODBC server working)

DBF - Database Format
        Various methods of allocating structures.  The dbf_struct would be
        basically what CircleMUD does now and the dbf_shm would be similiar
        but allocate in shared memory instead, allowing fast reboots.
 1) dbf_shm     Shared memory allocations.
 2) dbf_struct  Current structure based elements.

DBW - Database World
        What the "game" would talk to in order to manipulate the world.
 1) dbw_hash            Hash table (via glib)
 2) dbw_berkeley        Using the Berkeley database.
 3) dbw_linklist        Linked list (via glib, single or double)
 4) dbw_btree           Binary tree (via glib)
 5) dbw_sql [DBD]       SQL requests, using DBD drivers.

IDX - Index
        Basically loads the index files and figures out what else to call.
        Nothing fancy.

Module flow of control on bootup:
idx -> dio -> dfp -> dbw -> dbf

All C, with Glib currently.

George Greer            | The Ceramic Mouse & Snippets   |

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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