Why & When to Go Serverless
Serverless applications are built using the services provided by cloud service providers like AWS or Azure, without having the developer to worry about the underlying infrastructure. The core of serverless applications is made from cloud-native services such as AWS Lambda or Azure Functions, which offer Functions as a Service (FaaS). These services provide the ability to write event driven code functions in any of the supported languages. The functions are executed automatically when the associated events are triggered, creating an automated chain of events which can range from an API being called, uploading a file to the cloud or even invoking other serverless functions.
Downloads
Article (PDF-276 KB)MOST POPULAR INSIGHTS
- Streamline Your Application Delivery with AWS AppStream 2.0: An Introduction
- Secure Communication in a Hybrid Cloud – A Case of Site-to-Site VPN on AWS
- Understanding, Communicating and Making Informed Decisions with Data Visualization
- Cross-Account, Cross-Region Backups in AWS
- Writing Your Own Custom Playbook Action in Robusta
Serverless is the fastest-growing cloud service model right now, with an annual growth rate of 75%.
Source: RightScale’s 2018 State of the Cloud report.
One might wonder what benefits serverless applications provide or why are they getting so much traction these days. The answer to that question is in the pricing model of all of these services which is based on the philosophy that you only have to pay for what you use. Let’s consider Lambda as an example, the price of using Lambda is primarily based on how many times a function is triggered along with some other factors like the function execution time and the resources it utilizes. In contrast to non serverless services that are charged by the number of hours the service was up for.
If a business or developer runs an application on an instance or virtual machine hosted by a service that charges by the hour, they would essentially get charged for the total uptime of the instance, irrespective of whether there are any users using the application or not. If the same application is deployed using serverless services, it will be available all the time, but the account will only be charged whenever an end-user makes a request or uses the application.
Building applications through serverless architecture can be very effective for use cases where you want an application that is always up and available, but does not have continuous and constant incoming requests. The application can have a large number of incoming requests at certain times and then have large periods of stagnation with little activity. Other than that, asynchronous or event based tasks like CI/CD pipelines, multimedia processing, and scheduled batch jobs are well suited for serverless model. A couple of other benefits tied to adopting the serverless computing approach are mentioned in the figure below:
While serverless applications are bundled with various benefits, it is important to understand their core limitations that are often tied to the type use-cases and application models. From the pricing model of serverless services, it is pretty obvious that if the incoming events are large in number you would get charged more based on every input trigger. Services like Lambda or FaaS have limitations such as the amount of available RAM and accessible disk space being fixed for a Lambda function. Hosted functions also suffer from an issue known as Cold Starts, which means that every time a function has been dormant for a while it will take more time to spin up on the next request and thus cause a slight performance penalty. This issue can be minimized by using a runtime which suffers less from the cold-start penalty like Python or Node.js. It can also be minimized by reducing the overall function size.
Cloud computing also brings some limitations for serverless applications like vendor lock-in, where the switching cost to a different vendor is pretty high. If you are building a serverless application, you are committing to a specific cloud service provider and building your application around their infrastructure making switching across-platforms very difficult.
With all things considered, serverless is an interesting and in many cases a beneficial approach to building applications on the cloud efficiently in an agile manner, without worrying about managing the underlying infrastructure. It provides additional choices to solution architects while designing application architectures with minimal cost implications for their organizations.
Established in 2012, Xgrid has a history of delivering a wide range of intelligent and secure cloud infrastructure, user interface and user experience solutions. Our strength lies in our team and its ability to deliver end-to-end solutions using cutting edge technologies.
OFFICE ADDRESS
US Address:
Plug and Play Tech Center, 440 N Wolfe Rd, Sunnyvale, CA 94085
Pakistan Address:
Xgrid Solutions (Private) Limited, Bldg 96, GCC-11, Civic Center, Gulberg Greens, Islamabad
Xgrid Solutions (Pvt) Ltd, Daftarkhwan (One), Building #254/1, Sector G, Phase 5, DHA, Lahore