Lambda – Serverless
- Event-driven computing service. There is no server running. An event comes and the code gets executed.
- Serverless scales instantly (scales out, not up). If 1 million users hit the same request, 1 million lambdas will run the code.
- No Servers. No antivirus. No maintenance. No admins. No patching.
- Supported languages
- Node.js
- Java
- C#
- Python
- Go
- Serverless :
- DynamoDB
- Aurora Serverless
- S3
- API Gateway
- Lambda
- RDS is not Serverless (with exception of Aurora Serverless). They have a server but is managed by AWS.
- Lambda Timeouts: The default is 3 seconds. Max is 15 minutes
- Lambda Price: Pay per request and duration of functions
- AWS Xray: Service that helps you debug complex lambda architectures
- Triggers: Lambda functions can trigger another Lambda functions
Serverless Architecture
- API Gateway (to handle the requests)
- Lambda functions (auto-scaling)
- Serverless DB (Dynamo or Aurora Serverless)
Traditional vs Serverless
Traditional
- ELBs – > EC2 -> RDS
- Scale with Auto Scaling Groups
Serverless
- API Gateway -> Lambda -> Dynamo/Aurora Serverless
Serverless Application Model SAM
- CloudFormation for Serverless. Same scripts with CloudFormation, with some different tags
AWS Step Functions
- Coordinate multiple AWS services into serverless workflows so you can build and update apps quickly.
- Coordinate the components of distributed applications and microservices using visual workflows