How to Store a Chat?

They have: 5,633 posts

Joined: Jan 1970

Hi! I'm newbie!
I'm working on chat module using PHP and Postgre and I don't Know how to store the chats. Should I do it on files or as part of the data base??
If anyone has any pro ands cons or any new ideas I'm all ears..
Thanks!!! Laughing out loud

He has: 1,016 posts

Joined: May 2002

I don't believe there are any pros for using text file databases. They're slow, unreliable and eat all your server resources.

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

Since it was said "or as part of the database", I think what was being asked is if the actual conversation should be stored in the database, or in a text file and maybe have the database point to that filename.

The pro to having it part of the database is that then you don't have to worry about creating filenames, etc and where to store them.

Now, if you have the database on a different server than the web server, then (depending on how big the files are), there could be some speed difference haivng the files saved as text files on the web server as the program would not have to pull all of the data across from another server, just a link to a file that is on the same web server.

-Greg

s0da's picture

He has: 157 posts

Joined: Mar 2004

do you mean like a chatterbox type thing? that can easily be stored in SQL .. much better than flat-file.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.