Overiew
- Serverless computing
Model
- Lambda function - piece of code executed by AWS
- Java, Node.js, Python, C#, Go
- Contains "Handler" (execution entry, like "main")
- JS: exports.handler = function(event,context)
- Capacity configured by memory
- 128MB/lowest CPU - 3GB/highest CPU
- CPU/Networking increases proportionally
- Timeout: configurable
- Runs on A-Linux
- Use cases
- No idle servers/overprovisioning
- 100ms billing period
- Instant access to massive computing power
Security
- Permission to access other resources via IAM Role
Concurrency
- How many parallel may be executed
- Default soft-limit per AWS account
Invocation Type
- Sync: RequestResponse
- Examples
- AWS SDK (e.g. single client)
- API Gateway
- for internal caes use region endpoints (bypasses CloudFront)
- Never retried
- Examples
- Async: event based
- 128K payload limit
- Retried 2x
- Examples
- S3
- SNS
- Streams
- Retried all the time
- Examples
- Kinesis
- DynamoDB
Request Lifecycle
- Cold start
- Download code
- Start new container
- (optional) VPC ENI
- Bootstrap the runtime
- Warm start
- Start code
Versioning
- ARN
- qualifed: arn:aws:lambda:aws-region:acct-id:function:helloworld:$LATEST
- non-qualified: arn:aws:lambda:aws-region:acct-id:function:helloworld
- Publishing
- Immutable snapshot
- version incremented
- $LATEST - latest version
- arn:aws:lambda:aws-region:acct-id:function:helloworld:$LATEST
- Alias
- Enter to a specific version (symlink), e.g. PROD, TEST
References
No comments:
Post a Comment