Serverless for the win

You are working on your magical app and wanted the world to use it. What do you do? Well, you deploy it on a machine connected to the internet and start serving your application. This machine of yours is typically known as a server.

Physical Machine

When you setup your own physical machine you will have to maintain the complete machine, from the hardware to the OS and the installed applications. You will have to ensure power back up, network resiliency backup and security which seems to be a lot of maintenance effort taking focus away from developing and improving your app.

Virtual Machine

With the advent of cloud you now can get a machine on demand from any cloud provider of your choice and start serving your application from that machine. Mostly these machines are virtualised and are commonly known as VMs.

In this case you will get a Virtual Machine with the Operating System of our choice and will just have to maintain the OS and the installed applications.

Serverless

Let’s move one step further. What if you could deploy your app without actually getting a physical or virtual machine and so no maintenance involved. This type of architecture seems too good to be true but it actually exists and is known as SERVERLESS.

Lets make one thing clear here

Serverless does not mean we are not using any server. It just simply means that automation & tools have taken up the maintenance part and we can deploy our code and can run it seamlessly without ever worrying about the infrastructure on which our app is running.

Some common Serverless offering from large cloud vendors are

Benefits of Serverless Architecture

  • No server maintenance
  • Easy to package and deploy your app using many frameworks supporting serverless deployments
  • No cost if you are not receiving any traffic as serverless scale down the app instances to zero when not in use
  • No downtime due to server unavailability
  • Horizontal & Vertical Scaling provided by the environment

Drawbacks of Serverless Architecture

  • Vendor lock-in
  • Sometime packaging can become too complex and may need some specialised tools
  • Less clarity on where our application is running
  • More tools required for logging
  • Difficult to debug issues in code

Case study

We have leveraged serverless architecture on multiple occasions to deploy our applications. One of our most recent deployments highlights why serverless was the optimal choice for our use case.

We developed an application designed to transform content from one format to another—a process that is computationally intensive, requiring significant CPU and memory resources. However, the application is not used continuously; its usage is sporadic, with relatively low request volume most of the time.

Provisioning dedicated physical or virtual machines for such a workload would have resulted in substantial infrastructure costs, especially considering the underutilization during idle periods. Maintaining high-performance machines 24/7 for an application with intermittent demand would have been both inefficient and cost-prohibitive.

By adopting a serverless architecture, we were able to allocate high system resources dynamically—only when the application was actively in use. This approach not only ensured optimal performance during peak demand but also allowed us to scale seamlessly in response to traffic spikes, without the need for manual intervention or additional infrastructure provisioning.

Most importantly, serverless platforms automatically scale down to zero when the application is not in use, meaning we incur no costs during idle periods. This pay-per-use model significantly reduced our operational expenses while maintaining the flexibility and scalability our application required.

In this scenario, serverless architecture proved to be the most efficient and cost-effective deployment strategy.

Conclusion

We have compared physical, virtual and serverless architecture. In different cases different architecture will be more suitable but in our case as covered by the case study, Serverless was the most suitable architecture which has served us well since we released our app.

Leave a comment