I need to develop a web chat with one “advanced” feature: grouping chat – like the Skype’s chatting system.
The theory is trivial, but in practice it is very hard. Since last friday I was thinking about this, but I have no idea of how I can apply this architecture. Basically I need a database’s design with a good structure without store redundancy.
Ok……. so far it seems simple, but now I’ll introduce our main feature: history by user.
I can create one chat with 2 users. Ok, two days passed and I want to add a third user to join the conversation. The chat’s history for him will be different: he will not be able to view old messages in that chat.
Wonderful, huh? Remember, friends: I can not use XML to store the history locally. I NEED to user a SQL Database. In my case, I’m using SQL-Server, from Microsoft.
Can you all understand my problem? If yes, isn’t trivial, huh? Ok. Can someone think how I can solve this problem? I’m going crazy!
Actually the problem is trivial. Storing it in XML would be the real problem.
By adding the
ChatParticipationtable you will know exactly which is theChatMessageIdat which the user joined the chat (JoinChatMessageId) and don’t show him messages prior messages.LeaveMessageIdcan track when he left the chat room. Multiple join/leaves can be modeled as separate participation.