Serverless Technology
Nov 15, 2020
A reoccurring theme in the march of progress in computer science has been doing more with less. Gone are the days of ‘big iron’ mainframes taking up entire office floors. They have been replaced with rack mount servers, virtualization and now on demand cloud computing. Serverless technologies allow for even greater cost savings by taking this one step further and only paying for exactly the computer resources that are needed to perform the task. The major cloud providers have introduced exciting offerings in this space with Amazon AWS Lambda, Microsoft Azure Functions and Google cloud Functions to choose from. These are also beginning to be called Functions as a Service, or FaaS. Serverless technology allows you to perform workloads on demand in the cloud without directly accessing the underling servers. As an analogy, owning an on-premises server is like owning your own car; you paid for it up front and are responsible for the maintenance and gas. Using cloud virtual machine server instances can be likened to renting or leasing a car. It is owned by someone else, but you pay for it as you use it, you drive it, put gas in the tank, and you can give it back when you are done. Serverless functions are like taking an Uber, you tell it where to take you and only pay for the miles covered, you don’t worry about the car, the gas in the tank or even what path the driver takes to get you to your destination. In a serverless technology you still program the function for your workload, but many of the details are abstracted away. Service load is automatically scaled and balanced so it can grow extremely quickly without needing changes. The underlying infrastructure does not need to be maintained and updated requiring a large staff. The service is run on demand, so you are not billed for idle server time resulting in reduced costs. Many types of applications are good candidates for serverless functions. Small web apps are excellent candidates. Especially ones that are self-contained, use other services APIs, or have infrequent or high burst activity. They can be used to perform small redirects or other light website content delivery. Another common use is to create a function to act as an intermediary between two providers, for example between a website and a mail gateway. There are some drawbacks to serverless functions. Since they are only run on-demand, there can be a cold startup time which causes delays in infrequently use applications. While the cost is low for infrequently used applications, if the function is used constantly it may be more cost efficient to use a dedicated server. They are also not a panica for complexity, occasionally they can become overly complex to tie together many services; at which point it may be better to design a traditional ‘monolithic’ server application. Serverless functions can allow agile teams to quickly scale web applications without high cost or lead times. With good planning, they are a great tool in the developer’s toolkit.