AWS Lambda service should have been called AWS Scripts.
Lambda runs your code (currently Java, Node or Python). Things that you’d typically do with a server (or EC2) can instead be broken down into small chunks.
It’s like if you asked AWS to make you a custom computer whose one and only purpose was to execute your code block.
Flowcharts are commonly used to represent the entirety of a web application. Lambda’s would be the processing blocks within the larger program.
Amazon refers to each set of code, supporting libraries (like ImageMagick) and config files as a “Lambda function.” This is deeply confusing as “Lambda” and “function” are both used so often in so many ways in different programming languages.
In your overall application you might have several Lambda functions each of which does a discrete task. You could imagine an image processing application that takes each photo pushed into it and a series of Lambda functions on it.
In many ways Lambda is an executable version of the Unix Philosophy where you strive to make short, simple, clear, modular, and extensible scripts that you tie together into a larger system.
In the physical world, it’s immediately obvious when things are inefficient.
In the world of web services the inefficiencies aren’t always so clear, but at the core of things Lambda is an Amazon service that seeks to create a computing system that perfectly fits what you’re trying to accomplish.
Even better, Lambda is efficient in multiple ways:
Lambda functions are natively part of the AWS ecosystem and can be automatically kicked off when certain actions take place in other parts of your application.
For example: when an image is uploaded to S3, pass it to a Lambda and have it generate all the thumbnails for it.
This ability to set up events greatly reduces the amount of code and orchestration that you’d otherwise have to write.
If you’d like to get started with AWS Lambda, I’d recommend playing around with the JAWS framework: https://github.com/jaws-framework/JAWS
Official Docs: https://aws.amazon.com/lambda/
Read this Next: S3 Buckets of Objects