When is it a good choice to use Azure serverless functions?

Richard Basson
Nov 12, 2020 · 4 min read

What is serverless?

Let’s start by going into what serverless really is. No, it’s not the absence of servers but rather the abstraction of servers where you don’t have to deal with operating systems or infrastructure. This is all managed for you by Azure or your respective cloud provider.

How do Azure serverless functions work?

Azure functions serverless scales very well. In fact, it is one of its big features. So as the load becomes more, functions spin up and as the load decreases, the functions shut down. The Azure functions scale all the way down to 0 Azure functions. This means you don’t get billed at all for the time that there are no functions because there is no resource consumption.

  1. The second type of billing is based on resource consumption measured in gigabyte seconds. This is an average of the memory usage of your function and the time it takes to execute.

How do you get around cold starts?

Here are a couple of ways to get around cold starts, but they aren’t without their drawbacks.

  • You can keep your Azure functions up 24/7 by calling it on a trigger every 15 minutes. You can also achieve the same results by calling the function before it shuts down. This means that you are using resources of your consumption plan that could have gone to valuable compute.
  • You could optimize your code for the startups. This won’t get rid of cold starts, it will just reduce the time it takes to start up.

When should I use Azure serverless functions?

Now that we’ve gone through how it works, let’s get to the interesting part. When is it a good idea to use Azure functions?

DVT Software Engineering

Making an impact in Software Engineering