in reply to developing a intranet messenger system

hi i hav made a intranet messenger system more or less same like yahoo messenger.But problem with it is i m storing the messages in the database which is then retrieved by the respective users automatically after 2 sec. The corresponding message queue get deleted after the corrosponding user log out. Plz tell me a way to store the messages in a buffer at server side (using cgi + perl)which could be accesible by all the users logged in so as to save so many disk read and write done during storage and retrieval of messages from the database.

Replies are listed 'Best First'.
Re: problem in chat messenger
by davido (Cardinal) on Jan 24, 2005 at 05:12 UTC

    Only save to mass storage messages that are older than some amount of time. That way, the quickly retrieved ones are never committed to storage, and only the ones that hang around for longer periods of time get saved away for later retrieval.

    For this to work you would probably need your script to stay resident, which sounds like mod_perl.

    Update: Oh, and you can also read all the answers you go the last time you asked this question here: developing a intranet messenger system. :)


    Dave

Re: problem in chat messenger
by data64 (Chaplain) on Jan 24, 2005 at 04:34 UTC

    I guess you could use SQLlite and get it to store the file on some kind of Ramdisk. Otherwise you might have implement datastructures to hold the stuff in memory yourself. This will have to some process external to CGI so that different threads from the webserver can access it concurrently.

    Rather than re-implementing an instant messenger system, have you looked at using Jabber ?