Having emerged only a few years ago, serverless computing has quickly revolutionized the cloud computing industry. Some developers fell in love with serverless because of its simplified approach to development, increased scalability and reduced operational costs, among other reasons.
To learn more, we will talk with Stepan Slyshov, our experienced DevOps engineer, who has been extensively working with serverless computing for the past couple of years.
Stepan, thanks for joining us today! So, what is serverless computing? Does it really mean that servers are not used?
“Well, serverless computing is a cloud computing model that allows software developers to focus on building and running applications without the need to provision and manage backend infrastructure. Despite the cool marketing term “serverless”, nothing can run on just thin air. In serverless computing, the actual physical hardware is still present, but the responsibility to manage infrastructure orchestration is shifted to the cloud provider. So, at first sight, the term seems a bit misleading, but it is used to emphasize the invisibility of servers, not their absence.”
Can you provide us with the names of some serverless services we may be familiar with?
“The number of serverless services is growing constantly as new vendors emerge regularly. Among the most well-known examples are event-driven function services like AWS Lambda and Microsoft Azure Functions, managed databases like AWS Aurora or Azure Cosmos DB, and different computing services such as Google Cloud Run and AWS Fargate.”
Can you explain to us how serverless computing works? What makes it different from other cloud computing models?
“Typically, if you decide to host your application in the cloud, you have to deal with a bunch of routine tasks including setting up and managing servers, installing operating systems, updating security patches, scaling up server capacity - and this list can go on and on. Obviously, all these tasks require a lot of time, effort and resources.
With the serverless model, the underlying infrastructure management and resource allocation needed to execute an application become the burden of the cloud provider. The developers only have to write the code defining the application logic as functions that are triggered by events such as user requests, database changes or messages from other services. These functions are further uploaded to a serverless computing platform and executed once the corresponding event occurs.
As you see, serverless computing uses a function-as-a-service (FaaS) model at its core. Even though these two terms are often used interchangeably, FaaS is just a part of the serverless philosophy which implies an even higher abstraction level and contains an entire stack of other services offloaded to cloud providers.
Finally, in contrast to other computing models, the serverless approach shifts the pricing focus from the resources (like CPU or RAM) consumed by the application to the amount of time during which these services were provided. Your cloud provider dynamically allocates as many resources as you need for a certain task. This “pay-per-use” approach makes it an appealing option for businesses seeking scalability, faster time-to-release and cost-efficiency.”
From a developer’s perspective, can you list some benefits that serverless computing offers?
“When you browse through the websites of serverless computing providers, you will come across fancy marketing descriptions like “amazing speed”, “deploy in mere seconds’’, “no need to worry about orchestration, VM/container management” and so on. While these descriptions are true to some extent, they are not 100% accurate.
From a personal perspective, I can distinguish three main benefits of using serverless computing - cost savings, scalability and reliability. Let’s take a look at each of them separately.
Cost Savings. Serverless computing is the case when the “pay-for-what-you-use-only” mantra actually works. You are charged only for the time when your code is running and don’t have to pay for underutilized resources when the server is idle. In the end, it proves to be more budget-friendly than per-minute or even per-second payment models.
Scalability. The cloud provider automatically scales up or spins down the infrastructure if necessary. In a serverless model, the additional level of abstraction implies that huge amounts of worker nodes are already combined into a big pool of resources, always ready to give you what you need, with no additional steps asked. That’s why choosing a serverless approach can be a smart move for applications with unpredictable and fluctuating workloads.
Reliability. As the underlying infrastructure management is your provider’s responsibility, they usually dedicate more people, capabilities and expertise to the task than an average business can afford. This helps to reduce the likelihood of downtimes and service disruptions.”
Are there any drawbacks or limitations to using a serverless approach?
“Well, after more than 5 years of serverless technology being around, the initial hype is over, and we can now be more objective in discussing its drawbacks. Here are a few I’d like to mention:
Vendor lock-in. One of the main downsides of serverless computing is the overreliance on a certain provider. Since each serverless provider sets their own rules of the game, the application becomes strongly bound to the platform you use. As a result, it can be more difficult to switch providers.
Debugging challenges. Local testing and debugging can occasionally be hard because not all providers give you tools for that (like AWS SAM tools).
Limited control. As with any managed service, you trade accesses and possibilities for ease of use and simplicity. With serverless computing, you have limited control over infrastructure, which can make it difficult to customize or optimize it to meet your needs.
Not suitable for some apps. Due to the event-driven nature of serverless computing services, it is not a panacea for all existing applications. Decoupling some monolithic applications, for example, is just impossible by design. Moreover, serverless is not advisable for most of the stateful applications or those that need to run for a really long time.
Learning curve. Transitioning to a serverless model requires a steep learning curve, which can be a challenging process. Therefore, if your business wants to avoid most of the switching pains, it is better to seek assistance from experienced professionals in serverless tools.”
What types of applications are well-suited for serverless computing?
“Well, serverless computing can be a good fit for client-heavy applications, as they require fast and efficient server-side processing to support reach and responsive user interface. It can also be used for applications with a hard-to-predict load and “spiking” traffic (marked by occasional high bursts and small or even zero baselines). By automatically accommodating to the demand, it will ensure that your application remains available and responsive. In addition, applications that perform background data processing can also benefit from this technology. The cloud provider allocates resources based on the size of the task, which can save you costs and increase scalability.”
Can you provide us with an example of a real-life application where serverless computing can be implemented?
“Serverless technology can be used in various real-world scenarios such as a service for push notifications or a report-generating tool (like a news subset, or daily market summary from an exchange). Both cases fit the event-based triggers logic perfectly, and the dynamic allocation of server resources based on the volume of events will help to increase the overall performance and reliability of the apps.
Another example from my own experience is a tool that converts, transcodes, and compresses image, video, or audio files. This app processes, edits, and converts data based on the user request parameters to return a final media file. In this case, serverless computing works perfectly for handling variable volumes of media processing in a timely and efficient manner.”
Looking ahead, what do you think is the future of serverless computing?
“While the serverless model offers enticing advantages, it is far from being an ultimate solution and a flawless bright future for everyone. If you choose this path, you’ll still have to order the actual services from a provider, configure their properties within the available limits, and handle networking and permissions. Plus, you must have your pipelines prepared with all the necessary steps.
Therefore, I do not see a huge switch to serverless as inevitable. However, I do believe that many people will start using this approach for its attractive prices and scalability logic. After all, if you are already using abstractions and virtualizations for your resources, then why not go a bit further? The constantly improving options like AWS Aurora in serverless mode, AWS Fargate for Kubernetes cluster, GCP Cloud Run, or Azure Container Apps make taking the next step definitely worth considering.”
Thanks for sharing your expertise with us today, Stepan!
As you see, cloud computing is not a “one-size-fits-all” solution. Each business is unique, and the decision to switch to serverless computing or not will depend on your specific use case, budget, and technical requirements.