Serverless (FaaS)
In recent years, functions as a service (FaaS), also known as serverless solutions, have been developed by cloud providers and have become increasingly popular amongst cloud customers. The term serverless is somewhat misleading, because servers are still involved in the deployment process and run the code.
The intent of FaaS is to let the customer focus on writing code and not worry about any infrastructure, resulting in faster development. This is made possible by the cloud provider taking over the task of server management and eliminates any operational overhead. So serverless is more from a customer perspective.
With FaaS, you pay per compute time. Therefore, it is more cost-effective not to pay for idle resources and infrastructure. This is especially good for microservices and event-driven applications. Scaling is also handled automatically by the cloud provider. Customers store their functions in an appropriate programming language specified by the cloud provider in a database accessible to the cloud provider. Customer-selected events, such as HTTP requests, trigger execution of the function. The cloud provider then loads the function from the database onto a server, passes the event as input to the function, and executes it. Once executed, the function is removed from the server.
Functions will most likely not be deployed on the same hardware in a row. Therefore, it is important to note that serverless functions are designed to be stateless. This problem is partially solved by serverless containers. Here, entire containers are deployed as a response to an event. As long as the container lives, which depends on the user and framework configuration, the state can be stored in RAM. Serverless containers are either removed, after no incoming traffic was received for a period of time or if the container is done executing the code. To store data persistently, a database or nfs server can be used.
Transitioning to a serverless architecture is easy with serverless containers. However, if a monolithic architecture is used, the full potential of serverless containers is not leveraged. Therefore, it is recommended to use a microarchitecture. This will facilitate autoscaling, ensure that unused functions or handlers are not deployed, and speed deployment.
Last updated