Serverless applications still require servers to run; hence, the term is a misnomer. Serverless computing adds a layer of abstraction on top of a cloud infrastructure, so developers need not worry about provisioning and managing physical or virtual servers in the cloud. Serverless computing gives you the capability to develop, deploy, and run applications without having to think about provisioning and management of servers. Serverless computing doesn't need you to provision, manage, and scale the infrastructure required to execute your application. The cloud provider automatically provisions the infrastructure required for your function to run and scale your serverless application with high availability.
In most cases, when people think of serverless computing, they are likely to think of applications with backends that run on cloud providers, such as AWS, that are fully managed, are event triggered, and are ephemeral, lasting only for the invocation that runs within a stateless container. While serverless applications are fully managed and hosted by cloud providers, such as AWS, it is a misinterpretation to say that the applications are completely running serverless. Servers are still involved in the execution of these serverless applications; it is just that these are managed by cloud providers, such as AWS. One way to think about these serverless applications is as FaaS. The most popular implementation of FaaS at the moment is AWS Lambda. However, there are other FaaS implementations from Microsoft Azure called Azure Functions, from GCP called Cloud Functions, and from the open source serverless platform from Apache called OpenWhisk.
Serverless computing is all about the modern developer's expanding frame of reference.
What we have seen is that the atomic unit of scale has been changing from the virtual machine to the container, and if you take this one step further, we start to see something called function—a single-purpose block of code. It is something you can analyze very easily. It can:
- Process an image
- Transform a piece of data
- Encode a piece of video
The following diagram depicts the difference between Monolothic, Microservice, and FaaS architectures:
Monolithic versus Microservice versus FaaS
Developing serverless applications means that you can focus on solving the core business problem instead of spending time on how to operate and manage runtimes, or compute infrastructure, either in on-premises, or in the cloud. With this reduced overhead, developers can reclaim the time and energy that they would usually spend on developing solutions to provision, manage, and scale the applications that are highly available and reliable. I will touch upon this more later in the book.
The real goal of the serverless computing movement is to provide a high level of abstraction of the compute infrastructure so that developers can focus on solving critical business problems, deploy them rapidly, and reduce the time it takes for business ideas to be marketed, as opposed to the time it takes if you use traditional infrastructure for your applications.