What are the hosting models of Blazor?
Talking about the hosting model, the Blazor framework has two i.e., Server-side blazor and Web Assembly.
Ā
Blazor WebAssembly
WASM allows applications to run on a browser and for this to happen, it downloads everything like HTML, CSS, images, assemblies, and even complete .NET runtime which is then converted to WASM bytecode. Because of all these, it doesnāt need a server connection, what it needs is just to load into the browser, thatās it.
Here are a few advantages of WebAssembly ā
- Offline support for the Application
- No need for a server, what it needs is just resource processing at the clientās device.
- Seamless execution support in all modern browsers with faster performance.
- No Add-ons or plugins required.
Letās have a look at the disadvantages of WebAssembly ā
Ā
- It is limited to browser capabilities.
- Downloads everything including .NET runtime
- Might take longer load times because of increased downloads.
- Problems with outdated or traditional browsers.
Ā
Server-side blazor
Server-side Blazor enables you to run your Blazor app on the server. This simply means that the components of blazor can be executed on the server-side with .Net Core while other essentialities like UI updates, JavaScript function calls, event handling are managed by SignalR connection.
When the app is running, the browser communicates with the Blazor server application through the help of a SignalR connection.
Here are a few advantages of Server-side blazor ā
- Less need of downloading
- It runs faster
- Server-side keys are safe to use.
- No need for WASM.
Letās have a look at the disadvantages of Server-side blazor ā
Ā
- No offline support
- Requires a specific server or environment to execute on Asp.Net Core.
- High latency
- Scalability can be a challenge
In this blog, we will learn whether Blazor can be the future in web app development.