BLAZOR + STORAGE TABLES = TRUE SERVERLESS (UNLIMITED SCALABILITY)

Pablo Arthur-Rodger 1 Reputation point
2021-11-16T15:18:41.203+00:00

Blazor Web Assembly is a True Client Application, EVERYTHING is done in the Client Side, SCALABILITY is UNLIMITED! period.

But.......

Everything you do in Azure Functions can be done in Blazor at the client level, but When I try to do that I get "System.Security.Cryptography" API not suported on Blazor Web Assembly.

I could not imagine the Potencial that Blazor could directly call Databases. (without going to azure functions). True Serverless, unlimited Scalability!!!

How can I do that?, How can I circumvent this issue?

I was thinking to get SQLlite source code and add two functions, one function will produce a Token, and after that every request for insert, select, update and delete will required a token, that will be checked. I believe that will be a very popular database for Blazor web assembly developers.

But then I will need to install a Cryptography packet on Blazor web Assembly, that may not exist.

Anyone can give me any suggestions or guidance on this?

Thanks in Advance,

Pablo Arthur Rodger.

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
161 questions
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,445 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,484 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,017 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,008 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. PMonteIT 21 Reputation points
    2021-11-16T16:29:01.127+00:00

    Going directly to the DB from the client doesn't sound as a good idea from a security point of view. How do you protect connection strings on the client?

    0 comments No comments

  2. Bruce (SqlWork.com) 58,936 Reputation points
    2021-11-16T18:59:16.797+00:00

    You can not do what you want.

    please note that Blazor client (or any WASM) runs in a sandbox and can not access the network, filesystem, timer or true thread support (WASM is single threaded). For example HttpClient uses javascript interop to make a network call.

    the only local database you can access is one hosted by the browser. you access this via Javascript interop. You can create a C# wrapper for this:

    https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

    just as there are javascript databases that use local storage (see polyfil for above), you could write one in C# that was in-memory only and used local storage via javascript as a backing store. You could write a WASM database in C/C++, Rust, etc and load in its own WASM. You would need a javascript wrapper to load, and perform I/o and communications to javascript or other WASMs

    the issue with a crypto library with Blazor client is the management of the keys. You can call a javascript crypto routine or find a standalone C# version.

    note: SQLite is the most common database library used to implement IndexDB api. The storage is tied to the site, just like cookie storage.

    0 comments No comments