Scroll Top

Serverless computing

A compelling option for today’s digital enterprise
– By Anuradha Muralidharan & Raghunath Thiyagarajan

Background

The cloud has enabled organizations to worry less about their IT infrastructure and instead focus on their core offerings. Gartner Research’s Vice President David W. Cearley summarizes the cloud sentiment when he says, “Organizations that do not have a high-level cloud strategy driven by their business strategy will significantly increase their risk of failure and wasted investment” . Today, organizations of all sizes and businesses are moving to the cloud, freeing themselves of infrastructure issues.
This evolving demand for the cloud and the lack of skilled resources to manage containers or compute infrastructure has led to serverless architecture. With serverless architecture, businesses can re-imagine their offerings very quickly, from ideation to production. Serverless, contrary to the name does not imply there are no servers. Serverless computing is arbitrary units of compute that can be deployed without a worry about how they are mapped to hardware. Serverless architecture is applications built using custom code (functions) that run on a stateless, managed Functions as a Service (FaaS) platform, and typically orchestrated by events. For developers, serverless infrastructure means they can stop worrying about servers or containers and instead focus on their core jobs of development. The infrastructure worries are left to FaaS vendors whose job is to deliver the right amount of compute, storage, and memory.
Serverless computing is evolutionary and leverages the cloud to its maximum potential. Its origin lies in physical servers, which more often than not resulted in wasted capacity. Physical infrastructure evolved into virtual servers and then into containers. However, virtual servers and containers still needed skilled people to manage them. Also, whether your applications are built in a traditional multi-tier or a microservices architecture, they can only be scalled at a macro, application level. Serverless architecture addresses these two problems by composing the application into autonomous, individually scalable units (functions). The functions can be deployed to the FaaS platform and the provider taking care, instantiating, managing, and scaling the VMs and other resources. This allows businesses to consume computing infrastructure just as they would consume cloud services. Serverless computing also allows business to pay for what they execute instead of the compute power they reserve/buy from the Platform as a Service (PaaS) vendor.
All major cloud service providers have launched serverless projects – AWS Lambda, Google Cloud Functions, and Microsoft Azure Functions. These platforms are helping developers to be freed from the huge amount of coding that would go into connecting a program’s components to run on designated hardware.

Why serverless computing?

Digital transformation has accelerated business models. New products and services are created at an accelerated speed, and the resulting pressure on businesses to release new features and products is extreme. Customers’ expectations are also very high, and this is adding to the existing stress on businesses. The new digital transformation environment has created an easy entry path for serverless computing. In this accelerated world, building in-house components, investing in expensive hardware, installing servers, configuration and troubleshooting are overheads that businesses can very well do without.
Along with the macro changes, on a micro level, businesses are rethinking their offerings. Instead of staid, monolithic offerings, they are focusing on microservices and function-based executions.
The third important factor that has played a role in the evolution of serverless computing is Continuous Integration (CI). CI helps businesses to react to economic and business needs in an agile manner. Weekly and bi-weekly sprints with frequently evolving products require a rethink on infrastructure. Developers prefer infrastructure that can cope with frequent but small changes that can be at their disposal, be self-managing and scalable.
All these factors have resulted in a fundamental shift in the way businesses view infrastructure.

New York Times CTO Nick Rockwell is convinced that serverless, represents the next leg in the cloud journey. He tells CIO.com, ”Serverless makes products both reliable and scalable. In the long term, economically, it’s going to be a far better, far cheaper, far more efficient way to go.”

Serverless computing – The next generation of cloud computing

The three key core technology components of serverless computing stack includes the following:

Serverless computing is the next stage in cloud computing following Infrastructure-as-a-Service (IaaS) which helps by providing virtual machines for immediate consumption and Platform-as-a-Service (PaaS) which abstracts the entire OS and middleware layer to provide application development platform.
Serverless computing or Function-as-a-Service (FaaS) provides options to readily deploy a piece of code without worrying about its deployment. Also, serverless computing complements APIs which are end-user interfaces, where APIs will remain at the heart of the services and the backend server.

The building blocks of serverless computing

The first and most important feature of serverless computing is that businesses do not buy, rent, or provision servers to run their code. Other features are:

Cloud computing company Digital Ocean recently surveyed over 4800 IT pros, of which 55% identified themselves as developers. When asked about serverless, nearly half of respondents reported they did not fully understand the serverless concept. On the other hand, they certainly recognized the importance of learning more about it with 81% reporting that they plan to do further research this year.

Key benefits of serverless computing

Deploy in no time

Serverless computing enables speedy deployment of resources. While traditional infrastructure or even IaaS deployment can run into days, serverless infrastructure can be deployed in a few minutes, and subsequent uses of the same can happen in milliseconds.

Faster performance

Since the power behind serverless computing is often outsourced to cloud service providers, companies immediately benefit from high-performance data centers. It also helps companies to scale up or down as cloud vendors offer highly available, fault-tolerant services.

Cost savings

To understand the real meaning behind cost savings from serverless computing, one can look at an example. In this case, a business migrated to serverless computing to manage unpredictable and delayed response times between its databases. The move enabled real-time operational queries for downstream applications. The reporting from a 24-hour lapse to real-time allowed faster analytics. The organization could, because of its serverless model, create a centralized source of data. The final savings from intangibles such as faster analysis, intelligence and performance far outweighed the tangible savings which itself worked out to nearly $540,000 per year, from savings on support and maintenance costs.

Trigent’s managed cloud infrastructure services

At Trigent, we use a highly structured, agile, and collaborative approach to achieve business goals using the right cloud technology infrastructure. We partner with best-of-breed technology providers —Microsoft Azure and Amazon Web Services (AWS), to ensure the client’s services are perfectly tailored to business needs.

A Simple Implementation of Serverless Computing

Trigent’s current website https://trigent.com mostly static content, is hosted in AWS to provide high reliability, requires no administration and scales to handle enterprise level of traffic. We use AWS Lambda in a serverless architecture to build the small dynamic interactions needed by our marketing department.

The website is written in HTML5, CSS and JavaScript and the static files are hosted in an S3 bucket. The Content Delivery Network (CDN) is enabled across all regions using Cloud Front. The S3 bucket serves the static content / pages of the website.
We needed some dynamism – to collect information from visitors and to allow restricted access to walled contents. We implemented this using Lambda in a serverless architecture. When an user fills contact form with the required data and submits, JavaScript will call RESTful APIs hosted in Amazon API Gateway. API gateway internally calls respective Lambda functions.
Lambda functions are written in NodeJS. These functions perform validations, updates dynamo DB and sends emails using SNS service.

Access to walled content

When the user tries to download walled content such as a whitepaper, a click event on the page calls API. The Lambda function creates and sends back a signed URL of the content on S3, that is valid for an hour. After an hour, the URL will automatically become invalid.

File upload

When a visitor needs to upload files, say part of sales inquiry, Javascript will call an API. The Lambda function will create a temporary signed URL on S3 bucket and returns it to the browser . Browser will upload the file using that URL. Once done, it will call another API/Lambda function to mark the process as completed and invalidate the temporary signed URL that was sent earlier.

Summary

The future of serverless is gathering momentum as ecosystems continue to become more refined and secure. Jason McGee, VP, and CTO of IBM Cloud said at ServerlessConf 2017 that the serverless market would grow 7—times by 2021. Similarly, a Markets and Markets report predicted smaller, yet still substantial, growth, predicting the serverless market will grow from a $1.88 billion market in 2016 to $7.72 billion by 2021 (411%).