Back in 2008, at the LinuxWorld and Next Generation Data Center Expo, Stateless Computing was suggested as the future in Cloud. A stateless application does not rely on the session state of any kind to process a client request. For such an application you should be able to say that, for any request “this request can be processed by any server (in the cluster)”. It never relies on the previous requests from the client. This was one of the main constraint for REST & SOA architecture as well. The main problem Stateless architecture solves is scalability. By designing an application stateless you are bringing in the capability to horizontally scale it (also known as scaling-out). Virtualization and evolution of Cloud computing made it easy to provision additional servers to facilitate horizontal scaling.
Figure below shows a typical stateless application deployment in AWS.
But the latest trend is going one more step ahead and be Server-less. Though stateless application can scale-out, it requires additional servers/virtual machines to be deployed to run your application and distribute the load. This calls for the requirement of managing (provisioning, configuring, tear-down etc.) those servers and paying for them (per hour in case of public Cloud).
In a Server-less computing there are no servers to manage or run your application. You just supply the code as individual functions and it takes care of the execution, scaling etc. AWS Lambda and Microsoft Azure Functions are the leading examples of this service. It can be used as an event-driven model or as a request-response model. That means it executes your code only when needed and scales automatically, from a zero or few requests per day to thousands per second. You pay only for the execution time. “Functions As a service” is the name emerging out for this service, but a more apt would be “Execution As a service”.
Figure below shows a simple example with AWS Lambda. AWS API Gateway is a separate service to expose the Lambda functions publically.
Server-less computing is becoming increasingly popular and it is already marked as a milestone in the history of Cloud computing. It takes the simplicity and “pay per use” model of Cloud to the next level. You are responsible only for your code in a server-less application. Soon or later you will develop or use an application, website or mobile app which is completely server less – the next big deal in Cloud computing.
Michael Witting’s Life of a Serverless Microservice on AWS is worth reading for a practical use case. If you are interested in digging more deep into the theory, I would suggest reading Serverless Architectures by Mike Roberts.
PS: This article was originally published in LinkedIn: https://www.linkedin.com/pulse/what-better-than-state-less-anil-g-kurian