[DGD] Need some guidance

Shevek shevek at btinternet.com
Sat Feb 2 00:53:38 CET 2002


>You'd have to either link the MySQL libraries into DGD with some
>special commands to execute queries (which sounds like an interesting
>challenge, to me), or have some ability to create outgoing connections
>and connect to the MySQL port.  No clue how easy it is to communicate
>with a MySQL daemon, though.

Don't think it's amazingly hard to communicate with the daemon, once you 
can connect to the port.

>It all depends on what you want to do.  If you keep an object per
>table for the indexes (make sure you don't trip over the mapping or
>array size limitations) and an object per X table entries, then you
>can probably do some fairly efficient queries without needing to swap
>things in unnecessarily.  How many entries you store per object all
>depends on how big you think the individual entries will be (if you
>have some text or blob columns then it can add up rather quickly).
>
>Next problem: How to figure out where to store a table row.  You
>probably want to do something based on an md5 hash of the primary
>index of that row, take the first X bytes/characters (depending on
>whether you handle it as hex or not) and use that in a mapping from
>md5-indices to objects.
>
>Just my bit of brainstorming, hope it gets you started in the right
>direction somehow. :-)
>
>Erwin.

Thing is that shifting the DB into the DGD server gives me the all new 
hassle of connecting the Apache/PHP part of the equation to the DGD server. 
That sounds tricky to do when the connection for individual pages isn't 
maintained (I think), so you'd have to figure out a way of allowing the 
Apache server to form a connection every time it served a new page that had 
some DB content in it, without multiple users trying to use the same 
username/pass (Would be able to do that with some judicious use of session 
cookies).

Probably the most elegant way would be to use DGD to both serve the pages 
and maintain chat channels etc with MySQL functionality being included as a 
server extension somehow (Think that's what you meant above), effectively 
throwing away the PHP and Apache. That sounds a bit out of my reach, 
although I think there's a mysql c library available, which would make life 
a whole bunch easier.

Thing is that I'd prefer not to load up the DGD server with user initiated 
DB queries, Apache/PHP is a far simpler option for those, besides which I 
want cookie (And others) functions without coding them in LPC. All I want 
DGD to handle on the DB side of things is to control user independent 
events, like cleaning up the DB, updating information, moving non-user 
controlled objects around (Like an NPC in a mud). So all it really needs to 
do is let a daemon open 1 permanent connection to the DB (A local 
connection) and be able to use a few standard SQL commands.

Shevek

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list