The journey of distributed computing has evolved over the years from physical deployments to virtualization, to platforms, to services, to container orchestration and now towards server-less compute services. The word ‘server-less’ doesn’t mean lack of compute resources but rather a consumer perspective where such physical boundaries are non existent and computation happens on a need-basis.
Server-less architecture focuses on small granular tasks or jobs as opposed to more granular applications. The difference between an application and a task can be explained thus: applications are hosted at run-time and they need management of container, distribution, redundancy and orchestration; while on the other hand, task tends to be simplistic, task would start-execute-stop, scale, stay concurrent and possibly communicate to other tasks via asynchronous messaging.
Martin Fowler, 2017
Serverless architectures are application designs that incorporate third-party “Backend as a Service” (BaaS) services, and/or that include custom code run in managed, ephemeral containers on a “Functions as a Service” (FaaS) platform. By using these ideas, and related ones like single-page applications, such architectures remove much of the need for a traditional always-on server component. Serverless architectures may benefit from significantly reduced operational cost, complexity, and engineering lead time, at a cost of increased reliance on vendor dependencies and comparatively immature supporting services.
The goal of server-less computing platform is to provide an opportunity to reduce, organize, and manage complexity of an application, by tackling application as a bunch of services. Each service is composed of a bundle of specific tasks or actions or event based architecture. Thus changing the architecture is easier, which is an important factor for any long-term application. It does not replace the PaaS or container based architecture, however server-less architecture provides an alternative abstraction for building scalable and flexible on-demand services.
A Picture is Worth a Thousand Words
It is common to create applications in which services (either in built or that of third-party) are adopted as a part of the system (rather than creating services from scratch). These services are commonly known as Backend as a service (BaaS). Similarly, business logic can be coded in the form of functions that are hosted elastically in the cloud as Function as a service (FaaS). Also server-less systems use an event based architecture to trigger the functions or services on need basis. The following diagram illustrates how services and custom functions are created, deployed, and consumed by different parts of the software systems:
Serverless computing, is the new way of consuming cloud computing services. In this style of computing, the cloud vendors are responsible for service provisioning, maintenance and stability of services offered. The platform engineers focus on building context sensitive, new business features that are innovative and billed only against the amount of computation they consume.
There are many reasons as to why developers prefer server-less computing model:
- No Operations Overhead: Platform engineers are free from managing underlying resources such as infra and os. The cloud vendors provision and path the FaaS. This results in improved productivity as the cloud engineers can now focus on business functionality than cloud service architecture.
- Scalability and Availability: Both functions and events are small, granular, loosely coupled, stateless components. This makes the services easily scalable and thus effectivly avilable for consumers based on current load.
- Optimization: Services are invoked on a need basis, thereby only consuming and paying for what is essential. This will reduce the overall costs and also improves efficiency of the service invocation layer.
- Polyglot Options: The server less computing opens doors to use different languages and run-times depending on the specific use case under consideration. This provides liberty to platform engineers to use multiple languages within an application that best suits the task in hand.
However, server less computing is still in its infancy; hence, it is not suitable for all use cases. It does have limitations such as lack of good state management facility, vendor-lock-in, limited function support, and lack of debugging tools.
To summarize, there are many different ways to implement server-less compute systems or, managed services. The classical use cases that are suitable for server-less architecture are extensive. For instance, situations that demand less complex computations, that stay stateless and possess predictable behavior are worthy of this architecture. Data transformation, speech recognition, pattern mining, video object recollection etc are specific services that are executed once a while and would benefit from a need based serve-less (optimal), managed service invocation of the server-less architecture.