Over the past few years, many technological innovations such as infrastructure as a service (IaaS) and platform as a service (PaaS) have been developed to resolve the conflict in the responsibilities of server and other infrastructure management. In the midst came Serverless computing that allows developers to focus on code and move away from server and infrastructure concerns.
Although serverless computing differs from traditional cloud computing concepts, the term “serverless” does not imply that no server or other infrastructure is required to run applications. Instead, the service providers manage these servers and other resources. Serverless computing is a cloud model in which service providers manage all infrastructure management tasks such as server provisioning, patching, maintenance, backup, etc. At the same time, developers focus on their code and innovation without worrying about infrastructure.
Serverless computing is an evolution of cloud computing service models – from Infrastructure-as-a-Service (IaaS) to Platform-as-a-Service (PaaS) to Function-as-a-Service (FaaS).
Of late, serverless computing has become the fastest growing cloud service model. Serverless technology is already being used in production by large companies like Netflix, Coca-Cola, and Nordstrom. Large technology companies such as Amazon, Google, and Microsoft are offered under various brand names. Amazon introduced Lambda in 2014, Google Cloud Functions, Microsoft Azure Functions, and IBM OpenWhisk were launched in 2016. According to Grand View Research, the global serverless market size is expected to reach USD 19.84 Billion by 2025.
The goal of serverless services is threefold: to free cloud service users from dealing with infrastructures or platforms, change the billing model to pay-as-you-go, and auto-scale the service based on customer demand.
There are four components for any serverless application:
- Function: This is the compute service executing the code. While developers write a function to carry out any common task, the cloud service providers host and maintain the functions through the Internet and other services.
- Events: A JSON-formatted document containing data for a function to process is referred to as an event. The developers decide the event’s structure and content.
- Resources: Functions interact and communicate with other resources such as database and compute behind the compute services functions.
- Services: Services are the serverless component useful to solve certain problems. Examples of these services are SNS (Simple Notification Service), SQS (Simple Queue Service), SES (Simple Email Service).
Opportunities
No deployment and maintenance complexity
The first and foremost opportunity is to relieve users from managing the infrastructure already accomplished in IaaS. However, users still have to manage their virtual resources, i.e., installing and configuring related packages and libraries. Although users have to configure the application to match the PaaS requirements, Platform-as-a-Service (PaaS) providers have made the management slightly easier. It is a big step for serverless computing since users only have to register their functions and receive the credentials to invoke them.
Affordable scalability
Customers can deploy the functionalities of their applications without worrying about the scalability of the execution infrastructure or platform, which is another promise of serverless cloud computing. The scalability of these services is due to their auto-scaling nature, which means that each request causes the service to invoke a copy of the requested function, with virtually no limit on the number of concurrent requests. For execution, each invocation is assigned to the most feasible and available resource.
The affordability of serverless services is largely due to the providers’ lower costs. The lower costs are due to two factors: (1) resource multiplexing and (2) infrastructure heterogeneity. Resource multiplexing maximizes the use of available resources.
Consider the case where an application receives one request every minute, and each request takes milliseconds to complete. The average CPU usage, in this case, is extremely low. When an application is installed on a dedicated machine, it is extremely inefficient. Several similar applications could share that one machine. Infrastructure heterogeneity allows providers to save money by repurposing older machines that aren’t as appealing for other direct services (mainly because the execution environment is a black box for the customer). It’s worth noting that the cost of serverless services varies depending on the usage scenario; for example, in some cases, renting a virtual machine is less expensive than using the pay-as-you-go serverless model.
Applications
Though serverless computing is relatively new, it has paved its way into many real-world applications ranging from online collaboration tools to AI/machine learning and video processing and streaming.
1. Real-time collaboration and analytics
Because serverless services are stateless, they are good for real-time collaboration tools like instant messaging and chatbots. Real-time tracking is another example of a collaboration tool appropriate for serverless services because these applications are less reliant on the state of the system. Data analytics applications use serverless services as well. Various sources feed real-time data to a serverless service in these applications. The service collects, analyzes, and displays data analytics. Serverless computing’s auto-scaling feature allows it to handle multiple concurrent massive data streams.
2. AI and machine learning
One of the most appealing trends right now is machine learning in general and neural network-based learning in particular. Although the suitability of serverless in this domain has elicited mixed reactions from the research and industrial communities, deep neural networks can benefit from serverless because they allow users to break down complex model training into multiple functions without managing virtual machines or servers.
3. Video processing and streaming
To achieve low latency and low cost, serverless is a good choice for video processing and streaming. According to the studies, using Amazon Lambda to process a full-length HD movie with 1,000-way concurrency costs about $3 per hour of processed video. Compared to server alternatives, a serverless framework for auto-tuning video pipelines achieves 7.9 times lower latency and 17.2 times lower cost. During the COVID-19 pandemic, serverless video processing and broadcasting applications gained a lot of traction in the industrial and research communities.
4. System and software security
The serverless computing power has been used to provide security for a variety of software systems and infrastructures. Serverless services have also been used to detect intrusions. For example, StreamAlert is a real-time, serverless intrusion detection engine built on Amazon Lambda.
The serverless approach has great potentials to improve the security of systems and services due to various reasons, such as:
- Security threats are frequently sporadic. In these instances, pay-as-you-go pricing results in lower costs.
- There are sudden traffic bursts in some of the attacks. The auto-scaling feature of serverless services makes dealing with such a scenario easier.
- Attackers may launch widespread attacks that disrupt the victim’s various components and infrastructures. Serverless functions are self-contained in the sense that they can be run in a variety of environments.
To summarize, serverless computing is an event-driven computing model or code execution. The underlying infrastructure (including physical and virtual hosts, virtual machines, containers, and operating systems) is abstracted from the developer and service consumer. Applications run in stateless containers that spawn in response to event triggering. Functions, which run on containers in the cloud provider’s infrastructure, encapsulate the application or business logic. As the application load grows, more functions are executed proportionally, and the cloud provider handles the scaling of the underlying infrastructure. Scaling, capacity planning, management, and related administrative activities associated with maintaining virtual machines, server farm capacity, and operating systems are not required of users of these services.