Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recovering the app state after server downtime in server-side Blazor #9734

Closed
kjeske opened this issue Apr 25, 2019 · 4 comments
Closed

Recovering the app state after server downtime in server-side Blazor #9734

kjeske opened this issue Apr 25, 2019 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation

Comments

@kjeske
Copy link

kjeske commented Apr 25, 2019

Is there any documentation, article or other resource that shows the ways of solving the issue with loosing app state in server-size blazor? The documentation says:

Blazor server-side apps require an active SignalR connection to the server. If a connection is lost, the app attempts to reconnect to the server. As long as the client's state is still in memory, the client session resumes without losing any state.

It says that as long as the client's state is still in memory, the client session resumes without losing any state. But what can we do when the client's state is not in the memory anymore because the app was down after redeployment for example or when the client was disconnected and tries to connect again but reaches different server.

So the main questions are:

  1. What are the best practices of persisting the users app state and recovering it after the sever was down.
  2. How to make sure that user reconnects to the same sever after being offline (or if we can make sure).

I think answering those questions at early stage is important in terms of using server-side blazor in any kind of solid business where things like scaling out are in use.

When it comes to first question i suppose we could keep the state in Redis but then we would need to somehow identify the users, including anonymous ones, to have a unique key for each app state per user.

Would be also very nice to know how Blazor is managing the users app state in memory. And how to control the whole process of using it in order to put some extra logic to persist and recover.

The second question is maybe handled by Azure SignalR Service, but I haven't seen any solid article or documentation saying about it in context of sever-side blazor. I found a nice starting point here:
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr

@pranavkm pranavkm added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-blazor Includes: Blazor, Razor Components labels Apr 25, 2019
@kjeske kjeske changed the title Recovering the client app state after server downtime in server-side Blazor Recovering the app state after server downtime in server-side Blazor Apr 25, 2019
@enetstudio
Copy link

You can read more about the subject here: Reconnection to the same server
https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-0-preview-4/

@kjeske
Copy link
Author

kjeske commented Apr 26, 2019

Thanks @enetstudio , but unfortunately it doesn't answer any of those questions.

@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components and removed area-blazor Includes: Blazor, Razor Components labels May 1, 2019
@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@danroth27
Copy link
Member

Hi @kjeske. We don't have any documentation yet on how to do this, but it is one of our main areas of focus for our next milestone (preview7).

@danroth27 danroth27 added the Docs This issue tracks updating documentation label Jun 5, 2019
@danroth27 danroth27 added this to the 3.0.0-preview7 milestone Jun 5, 2019
@danroth27 danroth27 added the Needs: Design This issue requires design work before implementating. label Jun 5, 2019
@SteveSandersonMS
Copy link
Member

Closing as this is dealt with by dotnet/AspNetCore.Docs#13259

@SteveSandersonMS SteveSandersonMS removed the Needs: Design This issue requires design work before implementating. label Jul 17, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation
Projects
None yet
Development

No branches or pull requests

6 participants