I have a personal Blazor WASM project (here) that I want to add a simple database to, for storing user-created expressions. I’m currently looking at doing this by creating a REST API with Azure functions and some sort of database (probably also on Azure), but I’m writing this post in case anyone has better recommendations of how I should go about this, or any other tips. I’ve used C# for quite a while, but I have very little experience with databases, APIs, etc.


My main purpose for this is to get practice, but I also want something cheap that I can leave up for at least a few years without significant costs (assuming only a small number of users).
My main requirements are:
Low or zero fees, assuming that the number of users and database accesses is negligibly small.
The database needs to store trees of nodes (probably stored as JSON) that make up a regular expression, along with some simple metadata (Title, date, description, etc). I can serialize/deserialize the node trees on the frontend.
The application needs to be able to search over the submitted node trees based on their metadata, but the trees themselves are only accessed one at a time.
I’d like to have the possibility to add user accounts/authorisation in the future, but will probably start out with just allowing anonymous uploads from all users.
I’m not too worried about performance or cold starts (within reason), so long as it works and is cheap.
Given that this is primarily a practice/portfolio project, I’d like to mostly use technologies that are relevant in industry.
Is a serverless approach with Azure functions a good way to go about this, or should I use something else?
Well, as far as technologies used in the industry, you’d probably be safe going the common route of SQL and Entity Framework. This makes adding a user account system pretty easy since that’s supported out of the box. It’s easy to find documentation and help with that combination, and it’s quite popular, so a good place to start.
I don’t use Azure due to the associated costs. Last time I looked a few years ago I didn’t see a way to do much of anything useful for free for very long (it’s like they are trying to run a business over there or something), but you might want to try the NoSQL Cosmos DB offering, it looks like that is free, and probably more than enough for what you describe.
I prefer to develop locally then deploy using “Terrible” (Terraform+Ansible). Or when I want to get fancy, “Terribler” (Terraform+Ansible+Docker). Usually I just deploy to either a local VMWare VM, or to an AWS micro-tier VM instead of getting fancy with Docker or other cloud tools (none of my corporate partners in the last few years have wanted anything to do with them, so little incentive for me to stay up-to-date with their offerings).
Thanks for the response.
It looks like the AWS VMs have a free tier for a year, but then are charged hourly after that? I’d been hoping to have it running for at least a few years (ideally indefinitely) with very little traffic, so I thought something serverless might make it easier to avoid the recurring costs. I don’t know my compute requirements accurately enough to make a good estimate, but it looks like the cheapest VM options would still end up at about $50-$100 USD/year after the first year?


As far as I can tell, I should be able to use SQL+EF with Azure functions (or AWS Lambda if that’s cheaper), but do you know of any issues I might run into going serverless instead of just using a VM?
C# devs
null reference exceptions

source