PHP Chat

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
siri.2180
Forum Newbie
Posts: 4
Joined: Wed Jun 27, 2007 1:26 am

PHP Chat

Post 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
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

What disadvantages of using DB?
siri.2180
Forum Newbie
Posts: 4
Joined: Wed Jun 27, 2007 1:26 am

Post by siri.2180 »

Server speed gets down....

And presently we are done with this. But site becoming slow. We need the other ways.........
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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 ;) ).
Post Reply