In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is ASP.NET SignalR high availability design". In daily operation, I believe many people have doubts about what ASP.NET SignalR high availability design is. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "what is ASP.NET SignalR high availability design?" Next, please follow the editor to study!
In the One ASP.NET architecture diagram, Microsoft classifies WebAPI and SignalR into Services types as first-class citizens as MVC and Web Forms. Although the future ASP.NET 5 is still in the beta stage, it can be found in its architecture diagram that MVC and WebAPI, which are already very similar, are merged into the large framework of MVC, while SignalR still plays an important role in Services in the future.
SignalR is a technology that integrates a variety of HTTP communication modes and gives priority to using HTML5 Web Sockets as a real-time communication channel, and its design architecture is quite clear and easy to understand, so it can be seen that ASP.NET plays an important role in providing instant messaging service layer.
Environment
Before developing SignalR applications, you should realize that SignalR technology has some basic requirements for the running environment. To run the current SignalR 2.0, you need .NET Framework 4.5, server-side operating systems above Windows Server 2008 R2 and IIS7. If you use Web Sockets to make the best use of SignalR technology, you should run on Windows Server 2012 and IIS 8 (the development environment requires Windows 8 and IIS 8 Express). You can only choose to install Web Sockets extension components because of IIS 8 or above.
Online management
A very important capability in SignalR is "automated online management". When a client accidentally goes offline during operation, SignalR Client Library will automatically try to re-establish online within a fixed period of time to resume dialogue with Server. This feature is very important in today's environment. Here are two scenarios that are easy to understand:
Mobile online
The online status of the mobile phone has never been as stable as the desktop environment, and disconnection may occur at any time due to the mobile phone moving to different places (this often happens in the subway). Automated online management can get a good experience in such a scenario.
Update deployment
On the other hand, the disconnection does not necessarily occur only on the client side. When the application is restarted or the server-side software is updated and maintained, it will also cause disconnection, which is more likely to cause long-term website offline status. It often happens that the server is changed to provide services without changing the location of IP (the VIP that provides services). Are you aware of this? In this case, SignalR Client Library will go through the phase of disconnection and reconnection and still run very well.
However, it is worth noting that although SignalR Client Library automatically handles disconnection and reconnection, because the Web server instance has been completely replaced, if there is no corresponding design in the architecture, it may result in the loss of some messages in the original operation of SignalR. The next paragraph will explain the Backplane mechanism in SignalR to avoid possible loss of messages in this case.
SignalR Backplane
Backplane is a system extensible architecture design designed by SignalR based on publish/subscribe (hereinafter referred to as pub/sub) pattern. Backplane moves "information" from "inside the instance" to "external storage server", so that the state is no longer limited to instance individuals, so as to provide the ability of SignalR Server scaleout to support Web Farm architecture.
The figure above shows how SignalR uses the Backplane architecture to implement pub/sub pattern. First of all, the information is stored on the Backplane by the SignalR Server who receives the information request, and then the information is received and sent by multiple SignalR Server, and finally sent to the SignalR Client terminal.
Because the first feature of Backplane architecture is to move messages out (actions), it is a necessary design for Web Farm architecture, but it can also benefit from a single instance without having to worry about the problem of information loss that may occur when applications deploy VIP SWAP, which is very important for dealing with information-sensitive applications.
There are a variety of ways to support external storage of Backplane information, including SQL Server, Azure Service Bus and Redis Cache, and you can also implement other external storage methods on your own. The following is a further explanation for these three expansion methods.
SQL Server
Through simple setup, the SQL Database (or SQL Server) that developers are familiar with can be used to store SignalR information into the table, and then Service Broker can effectively forward the information to all SignalR Server processing in the system (Note: Server Broker is to increase efficiency, it can work without Service Broker).
The way for developers to expand the SignalR service with SQL Server is to obtain the Microsoft.AspNet.SignalR.SqlServer component in the project through nuget, and give the online string of the SQL Database storage individual that can provide the stored data. There is no need to establish a table in advance on the SQL Database instance, and the required table schema will be automatically established by the SQL Server component.
Detailed implementation information can be obtained from the SignalR Scaleout with SQL Server article provided on the official website of ASP.NET. It is worth noting that when using SQL Server as the information memory, the efficiency of information forwarding is lower than that of other schemes.
Service Bus
Service Bus is an important infrastructure in Azure, providing functions such as Queue, Topic, Relay and Notification Hub. Topics is a typical service of the same design as SignalR Backplane pub/sub pattern.
Detailed implementation information can be obtained from the SignalR Scaleout with Azure Service Bus article provided on the official website of ASP.NET.
Redis Cache
Redis is a service that stores data in key-value pairs in memory, and Redis also supports pub/sub pattern to provide information services. Detailed implementation information can be obtained from the SignalR Scaleout with Redis article provided on the official website of ASP.NET.
The way Redis operates with memory makes it a low-latency, high-throughput Backplane architecture.
At this point, the study on "what is the high availability design of ASP.NET SignalR" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.