Closed genifycom closed 2 years ago
Linking your old issue for some extra context: https://github.com/aspnet/AspNetCore/issues/9522
That is a good question about Blazor but I don't have the answer. I hope to research that soon and any input would be greatly appreciated.
Server side Blazor uses SignalR under the hood, the client connection state is stored in memory on the server. If the client connection is lost the session would need to be resumed and state would be lost, you could build a SignalR server but this is getting away from the desire for this to be serverless.
Just dropping my 2c. I would say that isn't feasible at all for serverless stacks like lambda. You need the server to keep the state in memory. The only way is if you "serialize" the state on something like Redis and implement a whole set of internal blazor components to get this state from there. I'm not sure Blazor currently would support that case. It goes way beyond just having the serverless websockets for transport (i.e. SignalR). It is a matter of state management which I believe isn't something modular right now on Blazor...
For serverless blazor, you still have an option for the client-side/webassembly mode (still in preview) which you can host on S3 and then use lambda as a "webApi" for it.
Fargate
To augment the Fargate answer: https://youtu.be/UfPGdYbtDTg?t=2599
Expanding on the idea of using a backplane Mass Transit provides a SignalR backplane that can be used as a work-around.
https://masstransit-project.com/advanced/signalr/
I was using that before I moved from containers to serverless suing aws api gateway.
SignalR backplane integrates with Redis. So I think it can ~easily be hooked up to elastic cache. I was using it with RabbitMq before I made the serveless switch over.
Its probably worth mentioning that using containers with an application load balancer is going to be far more expensive than using the web socket api gateway with lambda. Even just using the alb with lambda targets will be more expensive. This is especially true for those able to use the free tier for api gateway and lambda.
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
Once we have DotNet 3.0 or 3.1 LTS running in Lambda, how will we we support Server Side Blazor.
In AWS Lambda, WebSockets are not supported and can only be implemented via the WebSocket interface for API gateway.
Since the websocket piece is hidden, then in its current form it will not work.
Will there be any solution for running Server Side Blazor in AWS Lambda?