Serverless computing and FaaS

In Friday’s lecture was a brief mention of AWS Lambda and Serverless Computing. As a hardware engineer, I was intrigued and wanted to dig more into this, because the thought of being able to run computing workloads without hardware servers terrifies me!

The executive summary of serverless computing is that it is simply an abstraction for application (particularly IoT and microservices) developers so that they don’t have to deal with provisioning hardware resources. You can write application code, called a function, or choose from a library of existing functions (eg. compress a file uploaded to AWS S3) provided by leading cloud providers. Your function only runs when an “event”, such as a home security camera detecting motion [1], is triggered.

 

So why is this useful? Continuing with the example of the home security camera; in the absence of serverless computing, the company you pay for the service would have to continually spend money on hourly cloud resources (hardware compute, storage, network) even when the camera wasn’t viewing anything useful (or maybe even if the camera was off). Instead, with serverless computing, an event (here, motion sensor trigger) can be sent to AWS lambda, which then kicks off a function (which is the code the service has provided: would probably be along the lines of starting to record, triggering an alert to the user’s app, and/or the security company). This way, the company only pays when the service is actually being used. For AWS Lambda, which is the name of Amazon’s serverless computing cloud offering, customers are billed in 100 millisecond increments [2], and you can choose from a variety of pre-coded lambda functions (hence the rise of FaaS or function-as-a-Service)

In addition to the example provided above, here are some of the events supported by AWS Lambda [3]. Most of the examples are mine, and just a few of many applications:

  • Uploads to S3
    • Could be images or other files
    • Example use case: Whenever a user uploads a file to S3, compress it and store
  • Data updates to Amazon DynamoDB tables
    • DynamoDB is Amazon’s NoSQL database
    • Example use case: Whenever a user updates or removes a piece of information, send an email alert
  • In-app activity (using Amazon SNS)
    • Example use case: Whenever a user completes a certain workflow in the app, send a notification for an in-app purchase
  • Sensor Activity
    • Example use case: When rain detected, turn off smart sprinklers and start logging hours saved so as to present to user in monthly summary.

All in all, serverless computing shows a lot of promise particularly for IoT devices, but the server isn’t going anywhere!

 

 

[1] http://www.networkworld.com/article/3187093/cloud-computing/serverless-explainer-the-next-generation-of-cloud-infrastructure.html

[2] Technical Intro to Serverless Lambda; https://www.youtube.com/watch?v=QzipnZzAQEk

1+

Users who have LIKED this post:

  • avatar

3 comments on “Serverless computing and FaaS”

  1. Thank you for the exec summary, Gourav! Interesting concept that can be leveraged in a number of cases. I learned that it’s not HIPPA compliant so that will limit the application when it comes to applications touching sensitive data (e.g. health care providers.)

    1+

    Users who have LIKED this comment:

    • avatar
  2. Interesting post Gaurav.
    Functioning of lot of things becomes much easier with this service. Specially in the case of IoT.
    One is charged only when their code is running otherwise not. My question is, Is this a cost saving for the companies utilising this service or an increase in cost.
    Because, the cost of the hardware has not reduced, but the time & money taken to develop this product has been incurred. Which has to be charged to the ultimate user.
    In day-to-day life, had you noticed – Any product when bought in larger quantities is comparatively cheaper to it’s smaller sibling.
    In this case, when charged by millisecond, the chances are cost could go up for lots of users.

    0
    1. Hi Pratik, I don’t think this is an increased cost since the application still has to be deployed, in the case of SaaS, on a cloud (the cloud company has already purchased the hardware and set the price). It is just that you are now paying for less time on the cloud, and every msec you are paying for you are actually making money from the customer through a monthly subscription. Interested to hear more of your thoughts!

      0

Comments are closed.