duykhoa
duykhoa

Reputation: 2302

Store messages in chat website

I want to implement a chat website (like yahoo, google chat), people can signup an account and chat with their friends (a group). But I don't know how to store the old message, may be I should save the message in Database or in a separate file? In one time, an account can have more than one chat group.

Give me some advice, thanks

Upvotes: 0

Views: 308

Answers (2)

Sachin R
Sachin R

Reputation: 11876

Create a "messages_history" table in the database and stored the messages there. In this column may be userId, "message" etc..

or if you use file system then create new file for each user and update the file whenever any new message in chat.

Upvotes: 1

Magnuss
Magnuss

Reputation: 2310

Store the messages in a database.

Upvotes: 0

Related Questions