Modern-day application development is rapidly moving from legacy on-premise monolithic based architecture towards a cloud-based serverless architecture where whole applications are divided into smaller functions/services called microservice’s and each service is deployed as an independent function on a serverless computing platform and servers fully managed by the cloud providers as ( FaaS ) function as a service. In this article, we would try to understand what is serverless computing and why it’s gaining popularity and acceptability among the developer community and organizations.
Serverless computing is a next-gen way of building applications where developers have to focus only on writing code and don’t have to manage any server or have to worry about scaling. Application is decoupled into smaller functions/services depending upon business requirements, code is deployed as independent functions onto the serverless compute engine provided by the cloud provider which manages the server provisioning.
Functions deployed to this serverless execution model don’t run continuously as opposed to legacy server-based applications, whenever there is a request made to the deployed function/service the serverless computing engine dynamically allocates resources and spins the corresponding function into action and the request is served. Thus these functions run only for the time it’s serving request which eventually leads to lower costs.
It sometimes gets complicated as there is an overhead of dealing with multiple functions/services than as monolithic architecture. Thus, if you want to migrate your application over to serverless you need to tackle the complicated task of splitting your monolithic application into microservices/functions. The below figures show the architecture of a monolithic vs serverless application.
Nowadays many cloud providers have invested heavily in serverless computing and this is a clear prediction that serverless will be one of the most used cloud services in upcoming years. It’s a hot topic in the software architecture world because of The “Big Three” cloud vendors such as Amazon with the service named AWS Lambda; Google with the service named Google Cloud Functions and Microsoft with the service named Azure Functions are heavily invested in Serverless.
There are few big other services such as IBM OpenWhisk, Alibaba Function Compute, Iron Functions, Auth0 Webtask, Oracle Fn Project and Kubeless, etc, also provides the services to many companies and organizations.
As we know serverless computing is a way to build and run applications and services without having to manage infrastructure. It has several advantages but some advantages may be outweighed by other concerns. Let’s consider the pros and cons of Serverless computing.
As the application is broken down into smaller modules/microservices it provides a high level of decoupling,
One of the major advantages of serverless architecture is different programming languages /frameworks can be chosen to develop different microservices while in monolithic applications developers have to stick to a single language.
As the application is divided into smaller modules/functions it’s easily maintainable.
Serverless computing provides high availability and fault tolerance as it’s managed fully by cloud providers.
The “Big Three” cloud vendors service is briefly described in this section.
Amazon Web Services introduced AWS Lambda as an event-driven, serverless computing platform in November 2014. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code. On this platform, one can write the code and upload it to the Lambda function. Lambda takes care of everything required to run and scale your code with high availability. The billing is based on the computing time of service/function.
Languages supported by lambda Node.js, Python, Java, Ruby, Go, C#, Powershell.
Google offers serverless computing through their FaaS(function as a service) product called cloud functions which is also fully managed and pricing is based on pay as you go, model.
Languages supported Node JS, Python, Java, Go.
In 2016, Microsoft announced Azure Functions as their serverless compute offering. Similar to other clouds based services, Azure Functions is scalable on-demand, so you pay only for the resources you consume.
Languages supported Node JS, Python, Java, Go, Typescript, C#, F#, Powershell.
A major factor in the increased adoption and gain popularity of Serverless computing is due to its pay-as-you-go model where you pay only for the resources you consumed. As per the survey conducted by cloud management company According to the RightScale 2018 State of the Cloud report, serverless computing is the number one growing cloud service with a growth rate of 75%., according to a CB Insights Market Sizing tool, the serverless computing industry is estimated to grow from approximately $1.88B in 2016 to $7.72B by 2021. Another report published by The Cloud Foundry in 2018 showed that 46% of surveyed companies use serverless computing and that serverless technology is growing at a rapid pace.
Serverless computing is emerging as a new and compelling paradigm for the development of cloud-based applications, largely due to ease of development, maintainability, performance, scalability. Serverless computing is still evolving and in the future, we hope to see support for more languages /runtimes and cost-effective computing models. Serverless architecture is certainly very exciting, but it comes with the added overhead of re-structuring applications into smaller functions.