The cloud computing ecosystem is continuously changing, giving rise to countless options to run code, manage deployments and maintain infrastructure. The latest addition to this trend is the serverless (Function as a Service, or FaaS) computing model.
Serverless computing concedes us the liberty to make and run services and products without taking servers into account. A serverless application does not require us to provision, scale, and manage any server and can be built for virtually any type of application or backend service. All the necessary things needed to run an application is managed by a service provider.
Serverless computing or serverless or Function as a Service (FaaS)] is a model where a service provider dynamically manages the provisioning, scaling and allocation of servers. Applications run on containers that are invoked at the occurrence of a particular event. Applications are emphasized instead of infrastructure in serverless model. In serverless architecture, the user has the advantage of writing and deploying code without worrying about the underlying infrastructure. In this delivery model, applications are broken up into functions and can be invoked and scaled individually.
Working of Serverless Computing
The serverless architecture incorporates two components: Function as a Service and Backend as a Service.
- FaaS is a computing service that allows you to run self-contained code snippets called functions in the cloud. Your functions remain dead until it gets triggered. Functions are self-contained, small, short-lived, and single-purpose. They die after execution.
- BaaS is a cloud computing service that fully isolates backend logic, which takes place on faraway servers. It allows programmers to focus on front-end code and integrate the front-end with a back-end which is done by someone else. BaaS could be storage services, geolocation services, authentication, user management, and so on.
Serverless Compute Platforms
AWS Lambda lets you run code without provisioning servers. It has grown well since its inception in 2014. You are lucky if you code in Java, Go, Powershell, Node.js, C#, Python, or Ruby as AWS Lambda natively supports their runtimes.
Cloud Functions is an event-driven serverless compute platform from Google Cloud. One of the important serverless platforms to run your code is Google Cloud Functions. Cloud functions support Python, Node.js and Go runtimes
Benefits of serverless computing
Serverless computing is cost-effective, as it follows the pay-as-you-go model. You pay only when your function is alive.
Programmers making use of serverless systems are not affected by scale up or scale down headaches. The serverless provider handles all of the scaling on demand. Therefore, an unusually high number of requests from multiple users will be handled as smooth as a single request from a single user. A traditional application which make use of traditional on-premise server system will be down if it gets unusually high number of requests.
Quick deployments and updates
Using serverless computing, there is no need to upload code to servers or a need for backend configuration to release a working version of an application. A new product can be released very quickly by uploading parts of codes. They can upload code all at once or one function at a time, since the application is a collection of functions provisioned by the vendor.
Focus on product, not maintenance
The modular nature of the whole concept helps the programmers to bother about the actual problems and app enhancements rather than server problems.
Serverless architecture can speed up time to market. Instead of needing a complicated deployment process to roll out bug fixes and new features, developers can add and modify code on a piecemeal basis.
Limitations of Serverless Computing
Some specific long-running operations like database backups or data scraping may fail due to this timeout.
Timeouts can be caused by several main reasons:
– Large chunks of data that needs to be processed
– application needs connection to 3rd party apis/endpoints, that can be unavailable or reply with a long interval.
When we execute a serverless function for the first time, there exists a delay in time to start running which is also known as a cold start.
Breaking down a monolithic application in multiple microservices adds a considerable burden on infrastructure. While managing a single big application is easier to manage and operate than handling ten small functions. This not only increases the workload but augments a greater degree of complexity than before.
Migration to the serverless architecture is costly and time-consuming
New codes or functions might be needed for some legacy applications to work smoothly. Besides, testing and debugging is running in the live mode, so you pay additionally for this.
When you switch functions from one cloud service provider to another, it becomes increasingly complex to manage and monitor them.
Public cloud environments are used to allocate serverless architecture. Hence, before making a decision on using FaaS, privacy should be critical thinking point.
Difficulty in debugging and running test, as developers are shielded from the core server infrastructure and tooling.
Serverless is a cloud computing execution model where the provisioning and scaling of the servers are done by service providers. A serverless application runs in containers that are event-triggered, may last for just one execution, and the cloud provider manages the entire process. Serverless computing has many advantages over other computing models, like low costs, easier scalability, faster deployment etc.
For more information on the topic go to Innovature’s Cloud Computing page.