Serverless, FaaS and why do you need them?

by | 22.02.2021 | Engineering

In recent years, serverless adoption has started, with more and more individuals depending on serverless technology to meet organizations’ specific needs. A survey conducted by Serverless Inc showed in 2018 that half of the respondents used serverless in their job, and the numbers are projected to rise further.

In this post, we would get around the terms so that you can start your own serverless journey 😉

Let’s get started!

What is a Server?

If you have been on the internet even for a while, you have undoubtedly interacted with a server. Servers are a piece of specific hardware which ‘serves’ information or data to you. The specific hardware contains a lot of memory, speedy internet and generally hosted in massive data centres with other servers.

The Limitation

Hosting websites by buying your server is something you can think of, but you get limited if the numbers you calculate are wrong, which generally is the case. The under-provisioning (having less server capacity than required) and over-provisioning (having less traffic than the server can handle) of servers would take time from your development and cost you money.

You can always jump into a scalable cloud computing infrastructure. Still, then there, you must manage your infrastructure and would have to set aside time for your infrastructure management from the total time you could focus on development. Serverless helps you with this aspect.

Companies often invest less in cloud computing by using serverless services. The organization only pays the cloud service provider for the time their code is executed, instead of paying a flat fee for virtual machine (VM) instances that are always under- or over-utilized. Time is calculated in the form of applications, sometimes billed for every million requests. AWS, for example, charges about $0.20 for its serverless product per million requests.

What is Serverless?

Serverless helps you run an application without the need to configure or own the infrastructure even when the demand increases on an as-needed basis.

serverless doesn't means no server

There’s a misconception that serverless doesn’t require a server, but that’s completely wrong. Serverless run on the server, but the term signifies that you don’t need to worry about servers and the cloud provider takes care of them. They are the most flexible and cost-effective cloud computing technique to date.

How Serverless Works?

Developers rely on serverless to execute specific functions within the application code. We can call this model as a Functions as a service (FaaS) model due to this function-based approach.

If broken down into steps, a serverless lifecycle looks like this:

  1. Code Generation: Developers create a specific use case function with their choice of language.
  2. Event Declaration: A function only starts to pop up when an event happens. The event is often an HTTP request but can be queues, timers, and other various ways to trigger the function.
  3. Event Triggers: As soon the event is triggered via the specified ways, the function is executed. The trigger can be an application requesting information or a user clicking a button generating an HTTP response, or hundreds of other triggers.
  4. Function Execution: Before the function starts running, the cloud provider checks if an instance of the function is running or not. If not, it forms a new one for the function.
  5. Output: The function on execution generates a result that is sent back to the application specified on the code generation phase.

OpenFaas, OpenWhisk, and Kubeless are few frameworks you can use to build your serverless application.

Why use Serverless?

No Servers to Manage

You don’t have to worry about calculating how much hardware you need to provision for your requirements with FaaS. You can go to the market fast with your product because now you’re focusing mostly on your development and don’t have to worry about installing dependencies and other libraries.


FaaS helps you to scale automatically up and down if your service traffic fluctuates. Forget about configuring scale sets to scale your VMs, i.e., servers, if a sudden influx of traffic occurs. Your service on FaaS will scale automatically if it’s day or night, just depending on how much traffic you get.

Pay for usage

With traditional VMs, you can fall into the trap of the wrong size configuration of VMs (leaving full capacity unutilized), which could cost you extra money. Moreover, if you forget to shutdown VMs which are not in service, you could reck up a hefty bill.

serverless benifits

FaaS charges you for the requests or the function trigger and not any other parameters. This request billing translates into you only have to pay for how many requests you are getting and nothing extra.

Why are the drawbacks of using Serverless?

Cold Starts

The Serverless Computing environment dictates that functions are run on demand and, when not needed, are thrown away. All these efficiencies lead to a phenomenon called cold starts.

A cold start happens when your function is running the first time in a while. The underlying reason for this is the function must be downloaded, containerized, booted and primed to be run. This problem could increase your service latency if traffic spikes, and so some providers try to minimize it by pushing function on edge.

For visualization, think in a cold-weather your engine takes more time to start than when the engine was working a few minutes ago.

Third-Party Vendor Lock

Each cloud provider deals with its infrastructure differently, but migration is easy because it’s similar on an infrastructure level.

Serverless removes the complete responsibility from your shoulders and put them on the cloud providers. It merely means they are managing infrastructure, and now if you want to develop an application, you have to follow the providers’ path, which is different for each provider.

Suppose a serverless application is developed on a specific provider. In that case, it becomes hard to migrate to another provider (in case you’re getting a better deal there) as a different management system exists. This difference in management system helps the provider lock-in clients. You can see that’s why some cloud providers offer free tier encouraging developers to develop an application on top of their serverless infrastructure.

Hidden Costs

A typical application requires networking, disk, memory and API requests to function. Cloud providers try to outsmart customers by charging a different amount for each service or component need for an application to work. These costs add up drastically, and in some scenario owning your server via a cloud provider comes cheap.

serverless hidden costs

The cold starts also come costly as the users have attention spans in milliseconds, and if it takes more time than that, users will return to some other website. Fun Fact: Only AWS as few milliseconds cold start timing azure and GCP have them measured in seconds (more than 2 seconds in most case).

Read more about hidden costs in this awesome blog.

Final Thoughts⭐

Serverless is a new technology that is under development and makes your developer life easy. A long way to go yet in terms of technology to mature!

One thing to remember serverless can’t be a perfect use case for all your development life cycle, but if sifted through, some cool stuff can be build using serverless.

Happy Learning!


The DevOps Awareness Program

Subscribe to the newsletter

Join 100+ cloud native ethusiasts


Join the community Slack

Discuss all things Kubernetes, DevOps and Cloud Native

Related articles6

Startup speed, enterprise quality

Startup speed, enterprise quality

Liebe Kunden, Partner und Kollegen,2021 ist vorbei und uns alle erwarten neue Herausforderungen und Ziele in 2022.In den letzten 3 Jahren hat sich p3r von einer One-Man-Show zu einer festen Größe im deutschen Cloud-Sektor entwickelt. Mit inzwischen 11...

Introduction to GitOps

Introduction to GitOps

GitOps serves to make the process of development and operations more developer-centric. It applies DevOps practices with Git as a single source of truth for infrastructure automation and deployment, hence the name “Git Ops.” But before getting deeper into what is...

Kaniko: How Users Can Make The Best Use of Docker

Kaniko: How Users Can Make The Best Use of Docker

Whether you love or hate containers, there are only a handful of ways to work with them properly that ensures proper application use with Docker. While there do exist a handful of solutions on the web and on the cloud to deal with all the needs that come with running...

Cilium: A Beginner’s Guide To Improve Security

Cilium: A Beginner’s Guide To Improve Security

A continuation from the previous series on eBPF and security concerns; it cannot be reiterated enough number of times how important it is for developers to ensure the safety and security of their applications. With the ever expanding reach of cloud and software...

How to clean up disk space occupied by Docker images?

How to clean up disk space occupied by Docker images?

Docker has revolutionised containers even if they weren't the first to walk the path of containerisation. The ease and agility docker provide makes it the preferred engine to explore for any beginner or enterprise looking towards containers. The one problem most of...

Parsing Packages with Porter

Parsing Packages with Porter

Porter works as a containerized tool that helps users to package the elements of any existing application or codebase along with client tools, configuration resources and deployment logic in a single bundle. This bundle can be further moved, exported, shared and distributed with just simple commands.