Skip to content

Serverless Computing – Pros and Cons


How do you know if Serverless is the way to go?

Lately, there has been an increase in demand for computing services with many developing countries registering rapidly growing e-commerce sectors and not being able to handle the computer infrastructure to run these apps and platforms at such a fast pace. This is where a serverless approach can be beneficial. 

For the purpose of this article, we will only be focusing on the serverless solutions (commonly named as Function-as-a-Service), specifically on the benefits that they can bring to their customers and also on a few disadvantages that they can convey. 

Function as a Service (FaaS), this one is the most compared to a serverless architecture allowing users to run event-triggered snippets of code, consequently being able to form part of it, without representing the whole system. FaaS is essentially the compute-focused portion of serverless, the latter containing more services such as object storage, HTTP gateways, on-demand functions (FaaS), data storage (of various sorts), queues and many other services.

In the next sections of this article, we will go through a list of advantages and watch-outs that you should take into consideration when planning its deployment.

The Pros

  • Cost Saving

Cost saving is one of the biggest advantages of adopting a serverless solution. The Client is only charged in a “pay-as-you-go” manner, meaning that there are no costs when the services are not in use. Companies save upfront costs on hardware by having their infrastructure deployed and managed by the cloud vendor, they can also save up on human resources costs as services from infrastructure engineers are reduced to a minimum.

  • No Infrastructure requirements

In this type of architecture, no server management is required, although the serverless computing architecture is hosted on actual servers, developers do not have to deal with them. Servers are managed by the vendor, which facilitates the application to scale on demand. The whole point of this solution is to alleviate the developers from worrying about provisioning, managing and patching backend servers.

  • Scalability

Serverless offers great scalability, more flexibility and faster delivery time at a reduced cost. Infrastructure scales automatically as the usage and number of users increase.

As serverless solutions run functions when needed it is able to handle, with the same efficiency, just a single request from a single user or an unusually high number of requests.

  • Code

By using a collection of functions provisioned by the vendor as a source to run the application, developers have it easier when needing to update, patch, fix or add new features. They can upload code all at once or one function at a time. This results in shorter times for deployments and updates.

Developers can therefore dedicate more time and effort to new features and improving customer-facing elements (user experience) with server maintenance out of mind.

  • Programming Languages 

There are several programming languages supported by the different cloud providers, developers can choose based on their preference, one language to write their code on. When using FaaS, languages might be locked to a specific version, however, there is the option to use CaaS which allows the user to choose its preferable runtime.

  • Time to Market

By adopting a serverless architecture, developers do not have to worry about managing infrastructure any more, they can focus on what matters the most to them, such as solving issues reported by customers, working on new features and focusing on the customers’ user experience, this will decrease the time-to-market since apps will be fixed and deployed faster.

  • Event-Driven

Serverless is stateless, which means that it executes a task and does not store or reuse any requests. Each part of the application is independent and events trigger one another. If there is a failure it only impacts that event, not the entire log.

  • Greener Computing

Over the last few years, there has been a massive increase in the size and number of data centres around the world. On top of the resources needed to build these facilities, there are also the associated energy requirements, a large portion of it being used by unnecessary idle servers. However, vendors have been largely investing in renewable energy options with the intent of reducing the fossil-fuel-burning impact that would otherwise be necessary.

The Cons

Testing and debugging turn out to be more challenging. Harder to replicate the same environment and see how the code performs and behaves once deployed.

  • Long-running applications

This solution is not the best fit for applications that have long-running processes, as it would not be cost-effective. Being charged per time for functions that are constantly running and have a predictable workload ends up costing more than traditional setups. Also virtually speaking, no existing architecture ports over, so migration would mean starting from zero. 

Migrating legacy applications to a whole new infrastructure with an entirely different architecture may present a prohibitively difficult challenge that does not justify the amount of time and effort required.

The way some vendors approach tasks is by setting up a maximum time for functions to finish, for example, five minutes per function, if by then the task is not finished a new one is called with a new timer and so on until the task is finished. The number of simultaneous functions is also limited so if there are too many running at the same time it can result in the application experiencing a “denial of service” (DoS).

For all of these reasons, besides serverless applications that are designed from the get-go for serverless architecture,  serverless platforms are usually used as an adjunct to in-house servers, to perform tasks that require large amounts of computational resources.

  • It’s highly opinionated

By adopting a serverless architecture with a vendor the client is increasing reliance on that specific vendor. There is little standardization across platforms, every vendor has different features and workflows, therefore it is not easy to just change from one vendor to another at the clients’ desire. 

The hardest part of migrating to serverless is not the compute functions, but actually, the way in which applications communicate with connected systems like object storage, identity management and queues. Functions can be easily moved, but the rest of the application is not easily portable, which can turn out to be more expensive and less agile than expected.

  • Cold Starts

One issue that clients can face when their application has not been used for a while is what we usually call a Cold Start, the functions start up very slowly for the first time. This can be aggravated with the functions’ code size, so keeping the code short could help reduce the impact of cold starts, but developers might disagree, as managing numerous smaller functions can become an inconvenience. 

  • Multi-Tenancy 

A serverless architecture involves running multiple instances of software for several different clients on a mutualized infrastructure. Sometimes multi-tenant solutions can have problems with security (such as one customer being able to access another’s data), robustness (such as one customer’s software causing a failure in a different customer’s software) and performance (such as a high-load customer causing another to slow down).

  • Debugging

Debugging code that runs in FaaS is no easy task as some vendors do not provide tools that help with this job. It is still an area under current improvement and vendors have shifted their attention towards this problem and are actively trying to find a solution to tackle it.

  • Monitoring and observability

The same goes for monitoring capabilities, although vendors give clients some amount of monitoring support, clients inevitably see themselves depending on the amount of data vendors give them to work with, which might not be ideal for some customers to whom it is essential to oversee their applications.

  • Education

With any new technology comes the demand for training which carries a cost and consumes time. Developers need to be actively learning the way of new platforms, environments and infrastructure and the new methods on how to deploy their code.

Along comes the education and need for new skills and roles. An example is the position of System Administrator which has been slowly transforming into DevOps, which require both System Admin tasks and developing knowledge. 

The Verdict

With everything mentioned in this article, we will let the reader make their own assumptions about this technology and what specific challenges it can solve. This technology is still under (very) active development and so here is our take on what can be expected from it in the future.

Serverless, as we’ve seen, is not a perfect fit for all types of applications. There are specific use cases where it brings big advantages to the table and others where a traditional approach we’ll be your best choice (such as long-running processes-based applications). It’s a tool that is now available to mix and match with all the other tools in the cloud computing toolbox. 

By adopting a mixture of serverless and non-serverless architectures, developers can easily adapt part of their applications to their needs and avoid managing infrastructure when not needed.

This technology will keep evolving over the years as vendors are investing more into making it easier for clients to use it. 

More frameworks are being developed over time and greater support is given to already existing ones. This type of activity makes it easier for new developers in the serverless world, as it facilitates deployments. 

Find out everything there is to know about transforming your digital processes in this article!