Archive for December, 2014

Why I am excited about AWS Lambda

For me, learning about AWS Lambda was the most exciting AWS re:Invent announcement in 2014. Lambda is the back-end compliment to the front-end AWS Javascript API SDK released a year ago. During the 2013 AWS re:Invent Werner Vogles said onstage the AWS JS API SDK was one of the more exciting announcements in 2013 because it made possible single page web apps to run directly on S3 (and DynamoDB, etc.) without the need for EC2. Lambda completes the big picture.

What is AWS Lambda?

AWS Lambda is a new cloud service from AWS that completely abstracts the infrastructure needed to run your code. It’s the further manifestation of “let someone else handle the undifferentiated heavy lifting”. You write your code (Javascript for now) and AWS Lambda runs it in a dedicated virtual language runtime. You do not have to think about provisioning, sizing & monitoring EC2 nodes. 7 years ago the introduction of EC2 was revolutionary because it abstracted application stacks from data center provisioning & operations, and now Lambda leaps forward to offer “infrastructure-less” environments (sure… there are servers running “somewhere,” its just you don’t have to think about them!)

You only pay for execution time. Right now $0.00001667 for every GB-second used and $0.20 per 1 million requests thereafter ($0.0000002 per request). In typical AWS fashion the pricing model is multi-dimensional. You pay for requests to run your Lambda function and duration. Duration is a price based on time and GB memory allocated. Memory allocations range from 128 MB to 1 GB.

Why is AWS Lambda so exciting?

Lambda is in essence a return to massive shared compute environments, but with a modern twist. I learned to program on a CDC Control Data mainframe and IBM System/36. Each of these environments supported the concept of multiple jobs running at the same time, with a “human” scheduler coordinating start, stop, error recovery, duration and resource allocation. As a student, I had to “schedule” my homework assignments with the CDC controller, which often meant late nights in the computer lab. AWS Lambda is all this, but via API and you get to be the controller.

AWS Lambda turns EC2, S3, SNS, DynamoDB & Kinesis (and soon all AWS services) into a collection of shared resources you harness to both trigger your application or be the recipient of your application’s computational output. A classic example is an image file is uploaded to S3 that needs to be resized. With Lambda, upon the POST, you can have S3 trigger Lambda to run your Javascript resize functions. The input is the original image upload and the output are the resized image objects, stored back to S3. The output can also be further triggers to other AWS services, like updating DynamoDB or sending an SNS alert.

Virtual machines leapfrogged bare hardware
EC2 leapfrogged virtual machines
Containers leapfrogged EC2
Lambda leapfrogs VM, EC2 and containers

Each progression was toward ever more efficient utilization of the underlying physical resource (i.e. a host computer.) At the end of the day all these virtual services consume physical resources (metal, electricity, real estate) and Lambda is the next step toward extreme efficiency on the backend.

Read more…