Serverless In Action

Look, there can’t be a “serverless” service in the world of application development. The technicalities of what a server is, where it is, how is it maintained, how my application is hosted these are a few of the server headaches that you don’t have to think about, so using that perspective you have no server issues coz it not your problem, but Microsoft’s. MS Azure provides the Platform to allow you to develop all sorts of applications without a single thought to what the server looks like or sits, your development is serverless in that you don’t think about the server.

Serverless Computing | ISTENITH

 

 Just the Platform as a Service (PaaS) from Azure on a consumption basis, paying for when you use or have the application is used. Neat right. Imagine having just a function deployed? Accept parameters and send response? Without the heavy OS, runtimes etc etc? JUST a function that you only pay for only when its consumed? Yeah, that’s where we are with cloud. 

Azure functions(Azure Functions Overview | Microsoft Docs) is the serverless solution  touched on in this blog.  Lets say, I wanted to create a way to read WhatsApp messages and store them in a database, here is what I won’t do: I won’t develop an MVC project with an API controller which will read the incoming payload and store it in a SQL Express database, then I won’t find cheap webhosting to upload / create a DB then pay monthly subscription to handle incoming payloads, instead what I will do is can the idea like many I have shelved because the cost benefit analysis does look good for a one man operation. In-fact I would not even think about solution designing and developing such an app, because its not an App, it is just functionality I want triggered periodically, however if I want that functionality, it must be packaged as such.

This functionality looks promising, the solves one problem, reading WhatsApp, what about storage? Literally I want to save one thing, a message which is delivered in a particular format and maybe some metadata, that’s all, mySQL? MySQL is nice and everything, but I want one table, 1 TABLE. We are back where we started, a 4×4 to drive on a good road to go by milk, its too bulky for problem. I have configure a database server, create a database, create a table A TABLE. So, while I have solved the reading part, now I have a build a huge server (relative to what I want to do, MySQL is overkill, my data is not even relational I don’t need like 99% percent of a database engine. I do not need SQL; I wish I had a database that does not need SQL. I am an azure certified solutions architect and what you have asked for is quite literally the name of the solution. Its called NoSQL I won’t baby step you to a conclusion like I did above Introduction to Azure Cosmos DB | Microsoft Docs.

I have a solution, I have walked you through how as software developers we end up with solutions, we need to define and firmly know the problem.

For me to read and store WhatsApp messages, quickly, cost effectively, securely, and have a resilient solution, I am going to use an Azure Function to read HTTPs delivered payload and store the data in a CosmosDB. I have a bias towards C# so I will be using C#, however your Azure function can be written in other languages, refer to documentation.