Serverless computing helps application developers focus on their core business without having to worry about server-related problems. With a fundamental change in application architecture, it leaves the cloud provider running jobs such as server management, scalability and security. Its downsides include the potential need for code factoring to adopt serverless, its inherent architectural limitations and vendor lock-in as it is challenging to change serverless computing providers.
What is serverless?
There is no one complete and clear definition of serverless. However, in all cases, serverless does not necessarily mean that a software doesn’t need servers to run a program. There are two different serverless approaches:
- Applications that manage server-side logic and state. These applications use cloud-accessible databases, authentication services, third-party applications, cloud-hosted applications and services. These applications are related to a model of mobile backend as a service (MBaaS).
- Applications are written by developers but run in stateless compute containers that are event-triggered and fully managed by a third party. This side of the serverless definition is related to Function as a service (FaaS) term typically used when building microservices applications. AWS Lambda, was the first FaaS offering by a large public cloud vendor, followed by Google Cloud Functions, Microsoft Azure Functions, IBM/Apache’s OpenWhisk (open source) in 2016 and Oracle Cloud Fn (open source) in 2017.
Responsibilities of patching, securing, and scaling of servers are left to a third-party cloud provider in a serverless architecture. Using this model, applications and services can be built and run without having to manage infrastructure. Cloud services can be considered serverless if they meet the following criteria:
- The cloud service scales automatically.
- Pay-per-use pricing model; pricing is based on the number of executions instead of provisioned computing capacity
- There are no servers directly exposed that the owner needs to manage.
What are the benefits of serverless computing?
A recent Gartner research suggests that more than 50% of global enterprises will have deployed a serverless function platform by 2025, up from less than 20% today. The underlying reasons can be listed as follows:
- Ease of management: Thanks to serverless, developers can focus on their application. Infrastructure related responsibilities, such as server provisioning, are all managed by cloud providers. This reduces the workload of developers and DevOps teams.
- Autoscaling: Giving resource management to cloud providers not only reduces operational costs, but also reduces the workforce and effort required. Developers do not have to deal with problems such as heavy traffic or downtime along with serverless.
- Reduced latency: Backend as a Service (BaaS) model provides the infrastructure through the cloud system. Thus, it becomes possible to distribute servers to different geographic regions. Since no installed servers are leased and servers operate on demand, the code can be run closer to the end user. Thus, latency is reduced and user experience is improved.
- Speed and agility: With less provisioning and smaller implementation units, it takes less time to implement a business idea. Thanks to serverless, teams can focus more on the product development, allowing more time for updates and product features.
- Decreasing cost: Developers and DevOps teams don’t have to rent more server capacity than necessary. Cloud providers take responsibility for resource management and allocation, and pricing is based on the number of applications. Thus, there is potential to reduce operating costs compared to a case where the infrastructure team allocates unnecessary resources to the project.
Is serverless cheaper?
Cost is one of the most important criteria for cloud technology/vendor selection and serverless offers indeed quite low cost per compute prices (e.g. an example for AWS Lambda pricing can be seen below). However, exact cost is going to depend on the specific application and there are cases where Infrastructure as a Service (IaaS) will be cheaper than serverless. Each business needs to analyze their computing needs and decide the right approach for their problem.
In short, if you will be making full use of a resource, which is the case if you have frequent intensive computation work, IaaS is likely to be cheaper than FaaS. In other cases, FaaS is likely to be the cheaper option. We are considering adding a Google sheet for this calculation, feel free to leave a comment if you think that will be helpful.
How does serverless computing work?
The processes needed in the serverless model are seen as “a function to be applied according to the incoming demand”. Cloud providers offer functions as a service(FaaS). A function written and executed in a serverless model takes these steps:
- A function is written by the developer: The function serves for a specific task within the application code.
- An event is defined by the developer: The event triggers the cloud service provider to execute the function like a HTTP request.
- The event is triggered by a guest. A user triggers the event with an action like clicking to a link.
- The function is executed by the cloud: The cloud service provider checks if an instance of the function is already running. If not, the cloud provider executes a new function .
- The result is sent to the client: The user sees the result of the executed function inside the application.
What are the challenges of serverless computing?
The benefits of migrating to cloud-based serverless computing is balanced with the following challenges:
- Architectural limitations: There are two kind of architectural limitations as seen below. Using containers or virtual machines may be more suitable for situations in situations where these limitations hinder efficiency:
- inherent limitations like cold starts or initialization latency.
- artificial limitations such as limiting function runtime
- Less control over functions: For serverless FaaS model, application logic is executed when triggered by events. Some factorization is required for the application to provide these discrete functions. This can be a good model for applications following microservices architecture, but it can lead to a code sprawl when function management is difficult.
- Lack of experience on the market: An enterprise needs a major shift in application architecture in order to migrate to a serverless model. Serverless computing requires different skill sets, it is not easy to adopt different technology. Unexpected problems and failures can appear and most developers will be learning about serverless as they develop serverless systems. This can result in some delays in projects.
- Vendor dependency: Specific cloud providers use their own integration methods and tools. In addition, most companies will need to use multiple services from the same cloud service provider. It is easier to integrate services of the same provider. Controlling all aspects in one platform can be advantageous for deployment and scaling but it increases dependency. If user needs the application to be moved to another platform, significant time may need to be spent on rebuilding.
What are the top vendors providing serverless computing?
Leading cloud IaaS companies, including most tech giants, are investing in this technology. Serverless makes sense for IaaS companies from several perspectives:
- They will be relying on their IaaS infrastructure to provide this service and they already have a cost-efficient large scale infrastructure
- Serverless is a new infrastructure management paradigm and by becoming an early mover, they are shaping how serverless services are offered. This allows them to design a sticky service (i.e. making it hard for customers to churn once they go serverless)
- Leading companies are experimenting with serverless. By being one of the first companies in the space, they have a chance to work with early adopters
Google- Cloud Functions
IBM- Cloud Functions
If you have questions about how serverless can help your business, feel free to ask us:
How can we do better?
Your feedback is valuable. We will do our best to improve our work based on it.