Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing chat system: where to store chat data?

i am implementing a chat system in asp.net, much like google chat and i use xmhttp to send and receive data, and i am using a single table to store all chat for all user.

i wanted to create global temporary tables in sql using a XMLHttpRequest so as to be abl to organise data better(instead of storing all the chat in a sigle table which can(i dont know for sure) cause locking issues when many users are accessing it.)

also for my system i don't have to store the chat and so i thought that a global temporary table would be better since it will already be dropped and save me the trouble of clearing it.

but the after the table has been created by the Xmlhttprequest it gets dropped just after its creation....why this happen i don't know....i also have removed all connection closing lines but still no luck

so what should i do?? also if anyone knows of any online resources that can points me about best practices to follow please tell me.

like image 986
Abhishek Avatar asked Sep 11 '09 12:09

Abhishek


People also ask

Which database is good for storing chat messages?

This underpinning of development is carried in MirrorFly infrastructure which offers the best database design for storing chat messages for diminishing the queuing of messages and consumption of data.

Is Redis good for chat application?

Real-time chat app is an online communication channel that allows you to conduct real-time conversations. More and more developers are tapping into the power of Redis as it is extremely fast & due to its support for variety of rich data structure such as Lists, Sets, Sorted Sets, Hashes etc.

What are the 3 components of chat?

In general, chat systems consist of three main components: server class, communication class and client application, Figure 2. Server class is where messages are sent and received between clients and server.


1 Answers

Your table won't have locking issues with many users accessing it. Temporary tables are not meant to be shared cross-call, and you're going to wind up with far more roadblocks down that path. It is probably better to simply store your data in a table, then poll the table.

The only time you could have "locking issues" is if the users are attempting to write the same chunk of data to the same row at the same time ... which shouldn't be happening in a chat application.

Additionally, Google Chat uses a COMET style implementation instead of a polling implementation. It has been my experience that COMET > polling in terms of user experience.

like image 132
JustLoren Avatar answered Oct 04 '22 21:10

JustLoren