Use AWS Lambda to run code without provisioning or managing servers
You organize your code into Lambda functions.
The Lambda service runs your function only when needed
Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources:
server and operating system maintenance
capacity provisioning
automatic scaling
logging
With Lambda, all you need to do is supply your code in one of the language runtimes that Lambda supports.
You only pay for the compute time that you consume—there is no charge when your code is not running.
Lambda Use-Cases
File processing (for example when files are loaded to S3)
Stream processing** (e.g use Lambda and with Amazon Kinesis to process real-time streaming data)
Web applications
Combine Lambda with other AWS services to build powerful web applications.
IoT backends
Build serverless backends using Lambda to handle web, mobile, IoT, and third-party API requests.
Mobile backends
Build backends using Lambda and Amazon API Gateway to authenticate and process API requests.
When NOT to use Lambda
In cases where you have functions that manage, and mainly call other functions, your function is mainly waiting, so not optimal about costs.
Consider using
AWS Step Function
Don't use Lambda functions to jsut move data from one service to another.
Use service integration to do that (e.g, between API Gateway and DynamoDB)