I have a design question and looking for an efficient design.
I want user of my app to be able to send messages to each other.
I have the following table schema in my mind:
Messages
+ id
+ FromUser :id
+ ToUser : id
+ SendDateTime : Datetime
+ ReadDateTime : Datetime
+ IsRead : bit
+ IsDeleted : bit
+ MessageBody : text
Moreover, I want to implement a notification system, such that, when someone sends me a message, I want a notification to show up on my profile, like SO or facebook style.
I am worried about scalability of this design. One option i was thinking is to store the MessageBody in a separate table and make it lazy.
I m looking for alternative designs or ideas? I have done some research but no extensive info out there.
Any suggestions?
If you want the notifications to update in real time (because it would be cool), have a look at SignalR.
http://signalr.net
http://channel9.msdn.com/Shows/Web+Camps+TV/Damian-Edwards-and-David-Fowler-Demonstrate-SignalR
http://www.codeproject.com/Articles/404662/SignalR-Group-Notifications