user8951186
user8951186

Reputation:

How can I store chat conversation in asp.net?

I am building a website for chatting. If I store chat messages in SQL server database, then there are millions of rows of "Chat" table because only one message can be stored in one row. Is this cause lack of performance or not? Also I want to keep track of user ids for retrieving messages. May be I Have to create one table for each user to store his/her chat messages? Is it relating to multi threading when one user is chatting to multiple users? What is the strategy of Facebook for storing each user messages?

Upvotes: 1

Views: 610

Answers (1)

PSK
PSK

Reputation: 17943

If I store chat messages in SQL server database, then there are millions of rows of "Chat" table because only one message can be stored in one row. Is this cause lack of performance or not?

If your tables are properly indexed, there shouldn't be any problem. SQL server is capable of handling millions of records.

Also I want to keep track of user ids for retrieving messages. May be I Have to create one table for each user to store his/her chat messages?

You don't need to have separate tables for each user. You can have one table for users and one table for message and few other supporting tables.

Upvotes: 1

Related Questions