Cost of hosting ASP.NET Core Blazor Server App Vs MVC

Wonderful World 111 Reputation points
2021-03-03T12:25:47.76+00:00

To host a Blazor Server App, an Azure Service that can handle SignalR is needed. To host a MVC App, serverless or app service is only needed. Out of these two, which is more cheaper to host for an application that has 10,000 users and 500 users active all the time?

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,492 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Wang-MSFT 1,061 Reputation points
    2021-03-04T07:15:07.397+00:00

    Hi, @Wonderful World ,

    The count of users and active users are not enough for you to choose architecture.

    Shortly, you need to learn Blazor, Single Page Application (SPA), SignalR and MVC before answering your question.

    When to build a traditional web app

    • The app needs to support browsers without scripting, or the target browsers are out of date
    • The app needs to support older phones where scripting may run slowly
    • The app mostly serves static content or simple forms
    • The development team does not have experience with the relevant languages and tech. Note that Blazor brings C# to the web and somewhat alleviates this problem for developers who already use C#
    • Web APIs external apps do not need to reuse Web APIs built as part of the back-end.

    When to choose Blazor

    • Your application must expose a rich user interface
    • Your team is more comfortable with .NET development than JavaScript or TypeScript development

    **When to build a SPA **

    • Users expect a modern, rich user experience with a focus on interactivity
    • The target audience is up to date with modern browsers, and those browsers support scripting
    • The application is likely to be a data transfer heavy
    • The development team is familiar with the relevant languages and tech (TypeScript/JavaScript or C# for Blazor)
    • Web APIs need to be first-class citizens

    When to choose SignalR

    • Apps that require high frequency updates from the server. Examples are gaming, social networks, voting, auction, maps, and GPS apps.
    • Dashboards and monitoring apps. Examples include company dashboards, instant sales updates, or travel alerts.
    • Collaborative apps. Whiteboard apps and team meeting software are examples of collaborative apps.
    • Apps that require notifications. Social networks, email, chat, games, travel alerts, and many other apps use notifications.
    • SignalR provides an API for creating server-to-client remote procedure calls (RPC). The RPCs call JavaScript functions on clients from server-side .NET Core code.

    Below are some useful articles

    ------
    If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    Michael Wang


  2. Bruce (SqlWork.com) 60,866 Reputation points
    2023-03-14T23:38:04.4+00:00

    blazor server requires a persistent connection to each connected client (blazor page open in browser tab). in addition the blazor server needs to keep a copy of the blazor tree and component state for each connection (circuit context) in memory.

    if you are going to scale up, you may need a separate Azure Signal/R service in addition to the app service.

    so blazor server uses more server resources than an MVC or blazor WASM application and will cost more to host. If the applications used signal/r then it would be closer to blazor server in connection use.

    note: while an active browser tab will keep the connection open, if not active most browsers will close the web socket connection. if the tab is made active, the blazor page hosting app will reload, thus restarting the blazor server app. You need additional to code for the restart to be a restore.

    0 comments No comments