Serverless Computing - What To Know Before You Start Using It
Blog
  • Topics
  • Industries
  • Partners

Explore

Topics

Industries

Partners

Serverless Computing – What To Know Before You Start Using It

I am sure many of you are already familiar with Serverless Computing, and might have already used it in your projects. In this blog post, I’ll share my thought process around Serverless Computing, what it is, things to know before you start using it, and where you can use it.

The credit for Serverless Computing goes to Amazon. They are the pioneers, and started the Serverless movement with the launch of AWS Lambda. Later, several cloud vendors followed the bandwagon and started their own Serverless offerings.

Does Serverless mean no servers?

It’s a misnomer to say that. Certainly there are servers involved in running your code. It’s just that you are not managing these servers. Your cloud provider manages them for you, and unlike regular cloud subscriptions like PaaS, they are not always running. Serverless provides a layer of abstraction on top of a cloud infrastructure. Developers no longer need to worry about physical or virtual servers. Instead, Serverless allows you to run code directly in the cloud without provisioning or managing servers.

How does your code get executed?

Basically, your application alerts the cloud server when it should execute an action, and when that action is complete, the server essentially stops running until another action is requested. It is often referred to as Function-as-a-Service (FaaS) or event-based architecture. Essentially, it’s an event which triggers a function. It is a piece of code which automatically starts the server which runs this code. Once complete, the server automatically stops running. To understand how exactly the Serverless code gets executed, let’s look at a popular example from Amazon which talks about the most common use case for AWS Lambda.

Let’s say you are building custom photo library web software which allows you to upload your image and displays that image equally well on all devices such as laptops, mobile phones, and tablets. In order to do this, you upload an image to S3 bucket. As soon as the image is uploaded to S3 bucket, an event can be triggered to resize the file so that it looks good on all devices, then compresses the file to save the disk space, and finally copies that image file to a processed folder. The code that does all this is AWS Lambda, which runs only when the event is triggered. Once the file is processed, the servers that power the Lambda actions will not be active.

Who Offers Serverless?

As I previously mentioned, Amazon is the main pioneer in this technology, and their Serverless offering is AWS Lambda.

  • Google offers Google Cloud Functions
  • Microsoft offers Azure Functions
  • IBM offers IBM OpenWhisk

Apart from Amazon, Google, Microsoft, and IBM, there are several others that provide Serverless Computing, and some are open source as well.

What Are the Benefits of Serverless Computing?

There are several companies in the world who leverage Serverless to power their products. For example, Netflix implemented AWS Lambda to power their products at scale.

Some of the benefits are:

Cost:
The subscription cost for Serverless is less compared to other PaaS subscriptions. The reason is that the servers only run when necessary, and essentially during the execution period of the Serverless code. You don’t have to pay for idle server time.

Elastic:
With Serverless the functions that you run can automatically scale up to accommodate spikes in traffic, and scale down when there are fewer concurrent users without any manual management. This will help minimize costs, since you will only pay for what you use.

Administration:
Administration is automated, you do not have to update underlying software when a patch is available. There are no operating systems that you need to secure, or patch. You can simply concentrate on building the best product possible, without worrying about the infrastructure.

Microservices:
Microservices is a popular approach to development in which engineers build modular software that’s more flexible, scalable, and easier to manage than its monolithic counterparts. Serverless architecture fits very well with microservices.

What Are the Challenges?

As you all know, with every new technology the challenges and needs will start to take shape. The primary issues are with the internal implementation of the various cloud providers. Several FaaS offerings have emerged in the market, and apart from the prominent vendors, some are developed by the community. The challenges mentioned here are common to all FaaS providers, but each vendor might offer a unique solution to overcome some of the challenges.

Costs:
Though Serverless functions run only for a short period of time, sometimes it’s not possible to predict/limit the costs. Some vendors provide an alert mechanism wherein you can setup a threshold limit. Once the cost crosses the set limit, you will be notified. Still, you have to monitor frequently and take required steps to mitigate unforeseen cost increases.

Vendor Lock-in:
The main root cause for this is often not Serverless functions/FaaS functions itself, but the integrations with other vendor offered proprietary services. Once integrated with their services, it takes a while to move the code across vendors if you decide to do so, and it also takes time if the code base is quite huge.

Integration testing:
Integration testing becomes hard, and most of the time requires mocking the integrated services or running some alternate functionality for each one of them.

Service Discovery:
With distributed architecture, the service discovery is enabled for the services to be discoverable, if not externally, at least internally to each other. Though Serverless architecture is a distributed architecture, services aren’t currently discoverable, but will be in the future.

Configuration:
The best practice for most of the applications is to use environment variables to manage the configuration. Setting the configuration variables are not yet supported by most of the vendors. But, major vendors like AWS have already started supporting it.

So, considering all the benefits and drawbacks that we have with Serverless Computing, there are definitely several use cases where you can leverage Serverless functions. Most of the mobile based applications, games, voice enabled applications, IoT, media industry, and several others which are coming up/growing in the market are leveraging Serverless architecture. Considering there are several vendors and community who are trying to address some of the issues, add newer functionality… Serverless is the next big thing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up

Categories