Serverless Computing — Your new friend from the world of Cloud

Gaurav Singh Tanwar
5 min readMay 2, 2022

It serves when you want and you pay-as-yo-go

Photo by Boitumelo Phetla on Unsplash

If you have been in the tech industry for some time, chances are that you might have come across the term “serverless computing”. Almost every tech engineer I know has used “serverless computing” or at least has some basic idea of serverless computing. It’s everywhere.

The global serverless market size was valued at $3.1 million in 2017 and is projected to reach nearly $22 million by 2025, which would represent a CAGR of 27.9 percent from 2018 to 2025, according to a Research and Markets report that forecasts where serverless architecture is headed by 2025.

In this article, we will look at what exactly serverless computing means, the advantages of serverless computing, the disadvantages of serverless computing, and examples of some cloud serverless compute services. So, let’s get started.

What is Serverless computing?

Serverless computing is a method of providing computing services on an as-used basis. A serverless provider allows users to write and deploy code without the hassle of worrying about the underlying infrastructure. A company that gets backend services from a serverless vendor is charged based on their computation and does not have to reserve and pay for a fixed amount of bandwidth or number of servers, as the service is auto-scaling.

The term ‘serverless’ is somewhat misleading, as there are still servers providing these backend services, but all of the server space and infrastructure concerns are handled by the vendor. Serverless means that the developers can do their work without having to worry about servers at all.

Advantages of Serverless Computing

  1. Pay-as-you-go:

To understand this, let’s go to the early days of the web. In the early days of the web, i.e., before the emergence of cloud computing, building and deploying web applications wasn’t as easy as it is today. Anyone who wanted to build a web application had to own the physical hardware required to run a server, which used to be a cumbersome and expensive undertaking.

Then came cloud computing, where fixed numbers of servers or amounts of server space could be rented remotely. Developers and companies who rent these fixed units of server space generally used over-purchase the server resources to deal with the sudden spike in traffic or activity on their web applications. In most cases, this spike used to be for a very limited time. This means that much of the server space used to remain unused leading to lots of unnecessary costs.

Then came Serverless computing, our new cloud friend. It allows developers to purchase backend services on a flexible ‘pay-as-you-go’ basis, meaning that developers only have to pay for the services they use. This is like switching from a cell phone data plan with a monthly fixed limit, to one that only charges for each byte of data that gets used.

2. Scalable

Imagine that a prestigious university is going to release the list of students who will get admission into it at 8 AM tomorrow. In this case, what will happen is there will be lots of requests (visits) on the university’s website around 8 and eventually the number of requests (visits) will fall and would become normal very soon. To handle such a pattern of requests, we need to have lots of compute instances during the peak hours and then reduce the number of instances as soon we enter into the normal zone. That’s essentially what serverless applications can do.

Applications are built with a serverless infrastructure scale automatically as the user base grows or usage increases. If a function needs to be run in multiple instances, the vendor’s servers will start-up, run, and end them as they are needed. As a result, a serverless application will be able to handle an unusually high number of requests just as well as it can process a single request from a single user. A traditionally structured application with a fixed amount of server space can be overwhelmed by a sudden increase in usage.

3. Fully Managed

Up to this point, you might have got some idea of the potencies of serverless. Hence, understanding this advantage won’t be difficult. In serverless, you don’t need to worry about building and maintaining any underlying architecture and can delegate all responsibilities to the cloud vendor. Thus, developers can focus more on writing code and developing applications rather than worrying about the backend infrastructure. This results in faster development and deployment. Who wouldn’t want that??

Disadvantages of Serverless Computing

  1. Cold Start Problem

Cold starts can be defined as the set-up time required to get a serverless application’s environment up and running when it is invoked for the first time within a defined period. Cold starts are somewhat of an inherent problem with the serverless model.

Serverless applications run on ephemeral containers called worker nodes, where the management of these nodes becomes the responsibility of platform providers. That is where the wonderful features of auto-scalability and pay-as-you-go approaches arise since vendors such as AWS can manage the resources to match exactly the requirements of the application you’re running.

The problem here, though, is that there is latency in getting these worker nodes into the form of ephemeral containers up for your first invocation. After all, the serverless principle is that you utilize resources when required. When not required, however, those resources theoretically do not exist — or at least you don’t have to worry about them.

2. Not Cost effective for High and Constant Workloads

Serverless is ideal for deploying workloads that fluctuate rapidly in volume. If you have a workload that is relatively constant, however — like a web application whose traffic does not change by magnitudes from hour to hour — you’ll gain little from serverless.

So, before moving code to a serverless platform just because everyone is talking about it, consider whether the massive scalability and on-demand execution features of serverless will actually help you.

3. Long Running Functions

In the case of most workloads that are good candidates for serverless, this time is more than sufficient. But if you have a workload that is delayed by, for example, network bandwidth limitations, it may not be able to complete in time. You can work around this by chaining serverless instances together, but that’s a clumsy solution, and you’d be better off in most cases by simply sticking to other deployment solutions.

Some Serverless Cloud Computing Services

  1. Amazon Web Services (AWS)- AWS Lambda, AWS CloudFront Fargate
  2. Google Cloud Platform (GCP)- Cloud Functions, Cloud Run, App Engine
  3. Microsoft Azure- Azure Functions, Azure App Service

Conclusion

Alright!! In this article, we covered some basics of serverless architecture. We looked at what exactly it means. Then we looked at its pros and cons. Finally, we covered some serverless compute services offered by AWS, GCP, and Azure. I hope you liked this article. See you in the next article.

--

--