Live Chat for Asp.Net MVC 5.1

I have an Asp.Net MVC 5.1 website. We have 3 types of users, and I want to add chat support between them. I thought of some such models:

public class Conversation
{
    public NormalUser A { get; set; }
    public NormalUser B { get; set; }
    public List<PrivateMessaage> Messages { get; set; }
}

public class PrivateMessaage
{
    public NormalUser Sender { get; set; }
    public NormalUser Receiver { get; set; }
    public string Message { get; set; }
    public DateTime Created { get; set; }
}

In addition, I use SignalR in other parts of the project and I think this is a very good solution to add a chat interface on top of SignalR. So far so good. However, I think hitting the database to insert a new message EVERY time a message is entered is not a good idea. I have created so many strategies for implementing custom donut caching on my website to make every page as fast as possible, and it looks like it will undo them all! What is the preferred solution to this problem? I think I could do a few of these approaches:

  • . , ( / X Y).
  • , SignalR.
  • , , , . , !
  • . !

, , - ( , , (!) ..), . , , . , , .

+4
1

, , Firebase AngularJS.

0

Source: https://habr.com/ru/post/1538968/


All Articles