Search code examples
asp.net-coreblazorblazor-server-sideblazor-webassembly

ASP Blazor WebAssembly E-Commerce Security


I want to build an E-Commerce site with Blazor WA and API, and I know that Blazor Web Assembly keeps all the code inside the browser, so is it safe to implement all the CRUD calls in WA?

Or would it be hugely safer if i only implement a Blazor Server and do all the calls there without needing of an API?


Solution

  • First of all, welcome to Stack Overflow!

    You can read these articles that compare Blazor Server to Blazor WebAssembly much better than I can do: Microsoft Docs, Infragistics, Programmming with Wolfgang.

    After reading these you should have a clear understanding of what to use.

    In simple terms:

    • WebAssembly is an app that the user has to download. The bigger the app, the bigger the.
    • The server hosting model runs all the C# code on the server and then sends a rendered HTML page for the user to see.

    In my opinion, these technologies are overkill for an E-Commerce website. Your best bet would be Blazor Server but that comes with problems regarding scalability and cost. As the server has to keep alive SignalR connections with all of the clients, memory usage will be quite high. In contrast, scaling an API is like scaling any other web server.

    Last but not least, depending on how serious you want your E-Commerce business to be, an API is going to be a must if you also want to build mobile apps for your business.