Page 1 of 1

PHP Chat

Posted: Wed Jun 27, 2007 1:39 am
by siri.2180
Presently I am working with a site, in which our team needs to implement chat(1-1 or 1-many or many to many) application.

To implementing this, we are using DB to store the chat messages.

Is there any other method to store these chat messages?


Thank You,
Siri

Posted: Wed Jun 27, 2007 2:48 am
by Gente
What disadvantages of using DB?

Posted: Wed Jun 27, 2007 2:04 pm
by siri.2180
Server speed gets down....

And presently we are done with this. But site becoming slow. We need the other ways.........

Posted: Wed Jun 27, 2007 2:14 pm
by pickle
Server slowdown is the nature of the beast. Unless you've got thousands of users chatting at once though, you shouldn't have that big of a problem. I assume you're using AJAX to query the server every 2 seconds or so to get the updates?

A database is by far the best way to store data. There's less file handling overhead, and it's much easier to send to the user only the chat messages they need.

Posted: Wed Jun 27, 2007 2:56 pm
by patrikG
It's much more likely that your code needs optimizing rather than the DB being the culprit. Run a couple of benchmarks, look at server-logs to find bottleneck(s). If you're in a rush to get things faster, throw a couple of Gig of RAM at it (not literally, of course ;) ).