Allow all or specific parts or a Blazor Server application to be stateless (no continuous SignalR connection and state automatically moved out of memory after rendering) #40790
Labels
area-blazor
Includes: Blazor, Razor Components
feature-blazor-server
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Blazor Server provides an inspiring and powerful application development and state management model. However at present a continuous SignalR connection must be maintained between every client and the server which limits scalability. Memory also is a limiting factor.
While the stateful nature of Blazor Server is generally highly desirable, an application may have hot paths not necessarily needing statefulness. For example a news website may have very high traffic on its "/home" and "/read/{articleId}" pages but have orders of magnitude less traffic on its account management pages and discussion forum. Since article reading pages do not have high interactivity and stateful requirements, keeping these components in memory is wasteful.
Such optimizations can make the difference between a single server being able to accommodate 100,000 users or 10,000. Having this option will make Blazor Server as competitive as other technologies for consumer applications.
Describe the solution you'd like
After #30344 is implemented (which is a hard prerequisite), Blazor Server will be in a position to allow users to create stateless components. Here what I have in mind:
With stateless areas, the developer chooses to trade responsiveness for better scalability and resource management. This will typically be used on the hot path of public consumer applications as for such applications it is very common to have high-traffic public pages being fairly static (and driving conversion to turn visitors into paying customers having access to the full or actual product).
The benefit of defining stateless areas using routes is that since Blazor Components may be accessed from multiple routes, developers are empowered to - for example - provide a stateful and more interactive experience to paying customers and a static and less responsive version to non-registered users (being orders magnitude more numerous but generating less revenue) and they can do so without needing to modify their components.
This feature will allow developers to have the best of both world and will further position Blazor Server and Azure as the perfect high-productivity environment to develop the next-generation of web applications. I have a sense that this feature would be quite in reach once #30344 lands.
Additional context
No response
The text was updated successfully, but these errors were encountered: