Skip to main content

The Advantages and Disadvantages of Serverless

By May 16, 2019Article

Serverless computing is a major trend right now. In fact, cloud infrastructure service providers are looking to expand on this architecture as a new solution that focuses on applications rather than infrastructure. But I contend that serverless will not completely replace traditional servers in the cloud. 

For starters, let’s start with what the term means. Serverless refers to an application or API that depends on third-party, cloud-hosted applications and services to manage server-side logic and state propagating code hosted on Function as a Service (FaaS) platforms.

Even though the name “serverless” suggests that there are no servers involved, there will always be servers in use. Rather, it allows developers to not have to deal directly with the servers (it is more about the implementation and management of them). To power serverless workloads,  cloud providers use automated systems that eliminate the need for server administrators. This offers developers a way to manage applications and services without having to handle, tweak or scale the actual server infrastructure.

It is no surprise the top cloud providers that are investing in a major way on serverless include AWS, Microsoft Azure, and Google Cloud. In brief, here is how they approach serverless computing.

  • AWS Lambda is the current leader among serverless compute implementations. Lambda handles everything by automatically scaling your application by running your code as it’s triggered.
  • Microsoft Azure Functions enables you to run code-on-demand without having to explicitly provision or manage infrastructure.
  • Google Cloud Functions is a compute solution for creating event-driven applications and connects with GCP services by listening for and responding to events without needing to provision or manage servers.

Advantages and When to Use Serverless

Let’s look at why serverless is often a good choice. It allows organizations to reduce operational complications associated with infrastructure and related cost expenditures since they are computed for the actual usage or work the serverless platform performs.

When it comes to implementing, maintaining, debugging, monitoring the infrastructure, and setting up your environment, with serverless the heavy lifting is done for you. It allows developers to focus on application development, and not complex infrastructures, thus promoting team efficiency, better serving the customers and focusing on business goals.

Since serverless cost models are based on execution only, using serverless will reduce the cost of operations and save you money on cloud spend, making it more adaptable for short-term tasks on your environment. However, there are hidden costs to be aware of. Though we are considering advantages, this might as well be a disadvantage. Serverless apps rely on API calls, and the heavy use of API request can become very pricey indeed. In addition, networking costs can get very expensive when sending a lot of data and are generally more difficult to track in serverless costs models.

Some of the best use cases for serverless are:

  • Brand new applications that don’t already have an existing workload
  • Microservices-based architectures, with small chunks of code working together
  • Infrequently used scripts that don’t need a server running 24/7

Disadvantages and When Not to Use Serverless

There is increasing interest in serverless, but there are limitations that come with it. Perhaps these trade-offs are the reason why some companies, though interested in serverless, are not ready to make the jump from traditional servers just yet. 

Networking on serverless must be done through a private API endpoint and cannot be accessed through IPs, which can lead to vendor lock-in. This makes serverless unsuitable for long-term tasks. This means serverless is unusable for applications that have variable execution times, and for services that require information from an external source.

Serverless creates dependency upon cloud providers, and because of this you are not able to port your applications between different providers. Cloud providers own the burden of resource provisioning, so they are solely responsible for ensuring that the application instance has the back-end infrastructure it needs to execute when summoned.

By adopting serverless, you forfeit complete control over your infrastructure. For example, scaling is done automatically, but the absence of control makes it difficult to address and migrate errors related to serverless instances. This lack of control also applies to application performance issues, a metric that developers still need to worry about in a serverless environment. After all, serverless providers depend on an actual server that needs to be accessed and monitored.

Serverless is likely not a good fit for:

  • Rewriting existing apps 
  • Applications with variable execution times
  • Long-term tasks
  • Monolithic applications

Why Serverless Won’t Replace Traditional Servers

Though every business has different needs when it comes to cloud infrastructure, serverless won’t surmount the current cloud infrastructure of traditional servers completely. There are too many use cases where serverless is not applicable, or not worth the tradeoff in control (or perhaps even the cost). But as cloud service providers continue to invest heavily on serverless, it is fair to say that serverless usage will continue to grow in the years to come. 

 

Jay Chapel is CEO of ParkMyCloud 

Copy link
Powered by Social Snap