When application resources are no longer needed, they are scaled down to zero and the application ceases running. The customer pays only for the resources they need, and only when they are needed. In this way, customers can have access to large amounts of computing power without owning the responsibility for resource management.
Serverless computing functions are essentially stateless, not retaining any data from earlier instances. Where latency for applications is an issue, companies should evaluate whether serverless computing is the right choice, as it may take seconds for instances to spin up from a cold start.
This stateless existence also means that any persistent data that is necessary for the application must be stored elsewhere. All of the major cloud vendors who offer serverless computing offer databases and storage services that can be triggered by software functions.
Together, serverless computing, microservices, and containers are considered the heart of cloud-native application development technologies.
FaaS (Function as a Service) Is the Core of Serverless Computing
FaaS is a subset of serverless computing and is essentially the core of it. FaaS allows developers to write code that executes in response to an event. The code only tackles the business logic, not any of the complex infrastructure, which is handled by the cloud service provider.
All of the typical back infrastructure for hosting and launching an application over the internet — the physical hardware, server management, provisioning, web hosting, and virtual machine operating system — are all fully managed instead by the cloud service provider. Under the FaaS model, developers can create modular code to be managed as small pieces of executable code. For fast response, the code can be managed on the network edge.
FaaS offers many compelling attributes, including:
- Provisioning time measured in milliseconds
- No administrative burden
- Elastic scaling, including automatic scaling to zero
- No capacity planning necessary
- 100% managed maintenance
- High availability and disaster recovery with no extra effort or cost
- 100% resource utilization since there are no idle states
- Cost granularity in units of 100 milliseconds
Backend-as-a-service (BaaS) is a service model that includes access to third-party services and apps for activities such as user authentication, push notification, extra encryption, or cloud accessible databases, so that developers can focus on writing the front-end code for applications. All of the backend, behind-the-scenes processes of mobile and web applications are outsourced to the cloud service provider.
In BaaS, serverless functions are usually called through APIs. Unlike serverless computing, BaaS applications are not designed to scale unless the provider offers this ability, and the developer writes the code with this in mind.
Platform-as-a-service (PaaS) is a model where developers rent from the cloud platform provider all the tools needed to develop and deploy applications. This includes the operating systems and necessary middleware. PaaS applications won’t scale automatically unless they are programmed to do so. Unlike with serverless applications, which start instantaneously, PaaS applications must run most of the time in order to be available immediately upon demand.