Software Development

Blazor Server

This type of application executes fully on the server within the ASP.NET Core application. To communicate with the HTML, the server-side application uses SignalR. This is provided through the JavaScript file called blazor.server.js.

The server-side code was communicating with the client-side code in real time using SignalR.

the benefit of this type of application is that the download size is really small, significantly smaller than the Blazor WebAssembly, which means the application loads much faster. Because it runs on the server-side, it uses all the advantages of server capabilities with all the server-side APIs available. Additionally, we have full debugging support and our application can work on browsers that don’t support WebAssembly. This means, older browsers are supported.

Create a new blazor server app

Project structure of blazor server app

Run the application and inspect the downloaded files

SignalR Connection

Pros:
Server-side Blazor can be debugged in exactly the same way as any other ASP.NET application. Because it is, essentially, an ASP.NET Core application
1. No need for a Javascript
2. Small size, fast loading
3. You are using .Net Core
4. Debug like a boss
5. Run on any browser
6. Your code stays on the server

Cons:
server-side Blazor routes every single action to the server, the action will be delayed by the network latency. And it will use more bandwidth.
1. You need a server-side
2. No offline support
3. Higher latency, worse UX
4. Hard to maintain and scale
5. Each browser session is an open SignalR connection

One thought on “Blazor Server”

Leave a Reply