What is Serverless Computing and What Does Serverless means? — Beginners Guide..

Neel Deshmukh
4 min readMay 29, 2021

Today, I’m going to discuss serverless, but first, let’s define what serverless actually means.
Does it mean that there are no servers involved?
The answer is no.

What it means is that you’re as a developer are not responsible for managing and provisioning of these servers, it’s sort of outsourced to the cloud provider whereas you are as a developer focused on writing code or business logic.

Okay, now that we have defined what serverless mean, now let’s have look at the stages of deployment models over the past years:-

  1. Bare Metal.

In Bare metal days you were managing and configuring these servers and the environment that you want to deploy your code on. That means you are responsible for installing OS, all the patching and everything. It was and is quite time consuming to figure out that environment.

2. Virtual Machines.

Resource optimized from the bare metal where you were handling idle times much better. But at the same time, you’re still responsible for setting up your environment; again, installing OS and patching and everything.

3. Containerization.

Docker popularized this idea of containerization.
Here what you’re doing is you are packaging your deployment code, application code and all of its dependencies into a single container which could run on any underlying infrastructure. It simplified a lot of things from the deployment point of view but at the same time, some challenges with containers could be when you scale up your apps, management of containers becomes a challenge. At any given time, your application code is at least running on one server, so you still have some idle time.

4. Serverless.

Then we move to serverless which is where we are now. And in this, like I said earlier, in this model you are sort of abstracting from all of the underlying infrastructure and you’re focused mainly on writing business logic and not sever.

How Serverless actually works?

All of the major cloud providers have this Functions as a Service(Faas).
This is essentially a compute platform for serverless where you run your functions — We can say functions are, single unit of deployment of your code,
which is run by events or an action performed by the user.
Events are anything, think of it as a click of button the user has, and it creates an event which calls a function and then you run your code.
And in this serverless Function as a Service environment you have event driven architecture which is, again, an ecosystem provided by cloud provider which has different services running like database, IoT depending on how you want to build your app. So, those, all of them are emitting those events and you build your app, you look for those events and program that into your code.

Simple Serverless Architecture. Image Credit: Neel Deshmukh

Example: a user comes here on a client side and uploads an pdf file
and press a button to submit, it creates an event.
An event calls a function or invokes a function which does the compressing
of that pdf file and it stores into storage.
So, this is just a very over simplified example of how Function as a Service works and how you build your apps in that environment, serverless environment.

Advantages of Serverless.

  1. You pay for execution only. What that means is there’s no idle time.
    When your function is running, that’s the only time you are paying for that and its very cost efficient and functions usually run at 1000 milliseconds of times or depends on the task you are performing.
  2. Auto scalable.
    That’s a responsibility taken by a cloud provider again.
    When you architect your apps, you’re not planning for any of that,
    you are less concerned with the resources.
  3. Faster time to market.
    Since you’re not responsible for any of the management and deployment of any of the underlying infrastructure, you can build your apps faster, solve customer problems and bring them to market.
  4. Languages supported. Function as a Service allows you, you can write any language and frameworks that you are comfortable with.
    A lot of cloud providers have multiple languages that they support, so it could be very helpful in cases where you are comfortable with one language, you want to write in that.
  5. Highly available.
    What that means is that cloud provider takes care of all the fault tolerance and the MZRs — Multi Zone Regions — that they build to make sure that your app is always up and running. And all the services that you’re using in event driven architecture are also fault tolerant, so your app overall is always highly available.

Disadvantages of Serverless.

  1. Latency. Serverless functions mean you’ll be dealing with cold starts.
  2. Timeouts. These are stateless containers, they spin off for a little bit of time and are deleted afterwards. So, if your execution code does not finish in that time, your app could fail.
  3. Heavier reliance on vendor ecosystems. With serverless, you don’t manage the server. That also means you lose control over server hardware, runtimes and runtime updates.

Cloud Providers that offers Serverless.

AWS Lambda, Microsoft Azure Functions, Google Cloud Functions and IBM OpenWhisk are all well-known examples of serverless services offered by the cloud providers.

--

--