Why developers are not friends with Serverless



I recently watched a video by a good developer and youtuber called "Serverless Senselessness." I liked the thoughts of the author, but I disagree with some of his statements and want to discuss them in this article.



The video begins with a joke: "There are two things in the world that I don't understand - girls and serverless computing." I don't know anything about this developer's relationship with girls, but is he right about Serverless? Let's take a look at his main critical points and discuss possible arguments that advocate serverless computing.



Spoiler alert : I believe in Serverless. You just need to know when and how to use this technology.




Serverless criticism



The main argument against serverless computing is speed. Or the well-known cold start problem. Cold start is a delay in code execution (can reach up to 1 second for languages ​​such as JavaScript, Python, Go, Java, Ruby), which occurs due to the need to allocate computational resources, retrieve the code and launch the container from the provider side.



Sometimes it's really about milliseconds. This begs the question: is it really how quickly the code completes its task as the primary metric of success for application lifecycle management?



As a person who worked in IT and was faced with the development of relevant technologies, I am not sure what the speed metric is the key one. After all, there are other criteria such as speed of development cycles, ease of maintenance, payback time of the product, low costs for the end user, and reduced risk of disruptions by ensuring uninterrupted IT operations. Finally, saving developers time. If you think about it, Serverless Computing meets all of these criteria.



What are developers missing? The real benefits of Serverless



If you care about code execution speed to such an extent that the possible 200 milliseconds (up to a second) latency is unacceptable for your work, then serverless computing may not really work for you, and this is completely normal. However, this is not a reason to call Serverless a useless thing. Everyone must decide how unacceptable such delays are for him.



Serverless Computing is a powerful way to manage IT infrastructure, especially for companies that may not have the resources to buy their own infrastructure and hire specialists to maintain servers 24/7.



- Serverless . « ». Serverless, .




In most of the cases I've come across, using serverless computing is an order of magnitude cheaper than using self-hosted resources. This is true not only for the cost of computing power as such. What makes Serverless cheaper is that the solution saves the time it takes to operate, scale and maintain the infrastructure. You will experience real cost savings because you don't have to hire a team of in-house systems engineers. Good talent costs significantly more than serverless computing.



I'm not saying that serverless computing is a panacea and is suitable for everyone. If your workloads are stable and you have enough expertise to manage your infrastructure, you might actually be better off running on classic servers.



Cold start can be leveled



Going back to the question of code execution time, the cold start issue depends a lot on how you code and configure Serverless.



In general, there are many ways to soften a cold start by “heating” it up. So, you can run functions with some frequency, start a service more often, or keep some of the containers running all the time (if the provider allows it). These actions will provide the necessary “warm environment” for the functions to start.



Also, some Serverless providers offer built-in monitoring systems that notify you of any cold start functions so you can streamline the process. You can even sync with email or workspaces such as Slack — cold start messages will be sent to your inbox.



How much latency is acceptable for your workloads?



It's good if you know the answer to this question. Cold start latency is usually referred to as milliseconds. In all of the use cases I've come across in my job as a data engineer, delays in day to day work are not noticeable.



In addition, advanced providers allow you to create a hybrid infrastructure that includes serverless computing and servers.



Serverless computing is about NoOps and scalability



Serverless allows you to generate business value faster as the cloud provider takes over most of the IT operations. Allocates computing power, scales clusters to the required load, monitors security and updates, takes care of the integrity of equipment, and so on. Since the headaches associated with infrastructure management are gone, you can concentrate on working with clients. Is this the main thing in the end?



Serverless frees up the time of highly skilled engineers so that they can focus on solving business problems rather than managing clusters.



When is Serverless Computing especially useful?



Imagine you are starting a startup. You may not need significant infrastructure at first, and you may only have one developer. The Serverless paradigm allows you to start small and automatically scale as your business grows with a Pay-as-you-go cost model.



Another group that can greatly benefit from Serverless Computing is small businesses that do not have a large IT department. The ability to manage the entire lifecycle of an application with just one DevOps engineer (rather than a team of programmers) is a huge benefit of Serverless Computing.



If your site or app is under seasonal load, Serverless is a great option too. For example, if you have an e-commerce business, you are likely to experience peaks during Black Friday and New Years Eve. Serverless infrastructure allows you to adapt capacity consumption to such situations.



Also, not all events in life can be predicted. Imagine selling hand sanitizers, other antiseptics, face masks, and similar items in your online store. Then there was a global pandemic, and now everyone needs your products. With a serverless infrastructure, you'll be ready for any workload.



Speed ​​of code execution versus speed of development cycles



The speed of product development is also useful. In many cases, Serverless Computing supports a microservice architecture, which means faster development cycles and relatively independent architecture components from each other.



It turns out that Serverless helps to iterate faster in the development cycle and faster deliver the product to the end user, which just compensates for those milliseconds of delays due to periodic cold starts.



Disadvantages of Serverless that were not mentioned in the video



Some of the cons of Serverless Computing were not mentioned in the video, and I want to name them to give you a complete picture without embellishment.



While Serverless Computing may be ideal in some cases in terms of cost, scalability, and infrastructure management, it is not a panacea for everyone.



  1. There is a vendor lock risk . Providers make their services so convenient and cost effective that you run the risk of being tied to a particular cloud provider.
  2. , , . , SSH , ​​ , .
  3. , .
  4. - , .




In general, using new paradigms in IT, such as serverless computing or other cloud services, in the same logic as our familiar “home” on-premises technologies, is hardly a good idea. When you directly copy and paste workflows from physical infrastructure to the cloud, you lose many of the benefits of cloud services, if not at all.



There is no reason to expect that any technology will be applicable to all businesses, will have no drawbacks, and will be cheap.



From my point of view, we should not speak categorically about Serverless (as, indeed, about other IT solutions), considering only one aspect of work and ignoring the rest. Serverless computing makes sense. If you know when and how to use them.






All Articles