Blazor Server or WebAssembly: how do you choose?

The question is not which of the two is better, but what your application should do when the connection drops and how fast the first page has to appear.

  • Blazor
  • Architectuur

Two models, one component model

In both cases you write the same components. The difference is where they run: on the server over a SignalR connection, or in the browser on a .NET runtime that has to be downloaded first.

Since .NET 8 you no longer have to choose for the whole application either. You can decide per component how it renders, and a statically rendered page needs no runtime at all.

When server is enough

For internal applications on a reliable network Blazor Server is nearly always the simplest choice: a small download, direct access to the database, no separate API layer. The price is that every interaction costs a network round trip and the server holds memory per user.

When WebAssembly pays off

As soon as users are on variable connections, need to keep working offline, or the application is heavily interactive, WebAssembly wins. Combine it with prerendering on the server and the first page is there immediately, with the client taking over afterwards.

Running into the same thing?

Email the question. You get an answer from whoever wrote the article.

An unexpected error occurred. Reload 🗙