Containers and serverless technologies in AWS
Károly Sepsy – Head of Engineering @ TC2
0 9 . 1 0 . 2 0 1 9 .
Intr
od
uct
ion
Src: codetee.com
Intr
od
uct
ion
AWS portfolio
AWS portfolio for serverless and containersIn
tro
du
ctio
n
Serverless
Lambda
• Function as a Service
• Event driven
• Asynchronous
• Scale by process
• Billed by 100 miliseconds
• Platform integrations
• Limits
Serv
erl
ess
Operating functions
• Cloudwatch metrics
• Error-success rate
• Throttles
• Invocations
• Cloudwatch logs
• Function outputs, errors logged
• Monitor log patterns
• Dead letter queue
Serv
erl
ess
Lambda event sources
Developing Lambda
• AWS Console editor
• Cloud9 IDE
• Development in local environment
• Debugging
• Test events
• Dependency management
• Layers
• Serverless application repository
• Deploying a release
• Versions, aliases
• Serverless application model
Serv
erl
ess
Lambda billing
Function execution
• Duration: 2074.97 ms
• Billed duration 2100 ms
• Memory size: 128 MB
Billing unit (besides free tier)
• $0.0000166667/GB-second
• $0.0000002/request
Cost: $0.0000002+$0.0000166667/8*2.1=$0,00000457500875
Serv
erl
ess
Operating functions
• Cloudwatch metrics
• Error-success rate
• Throttles
• Invocations
• Cloudwatch logs
• Function outputs, errors logged
• Monitor log patterns
• Dead letter queue
Serv
erl
ess
Building workflows of function
Building workflows of functions
• Visual workflow
• JSON defined template
• State machine
• Sync and async calls (wait for callback)
• Supported services for steps:
• Lambda
• Container execution (ECS)
• ETL (Glue)
• Machine learning (Sagemaker)
Serv
erl
ess
Containers
Containers on AWS
• ECR: Container repository
• ECS: Container orchestration service developed by AWS
• Fargate: Serverless Container runtime for ECS
• EKS: Container orchestration service, based on open source
Kubernetes, managed by AWS
• Batch: batch processing service using containers
Co
nta
iners
Serverless containers: Fargate
• Option for Elastic Container Service
• Specify CPU and RAM needs for containers
• No need to manage servers
• Billed after used container capacity
• Storage limits
Co
nta
iners
Firecracker
• Technology behind Lambda and Fargate
• MicroVMs
• Linux support (kernel version >= 4.14)
• VM like isolation and security
• Container like startup time
• KVM based
• Containerd support
• Written in Rust-lang
• Similar to KATA containers
• RESTful control API
Co
nta
iners
Elastic Kubernetes Service
• Standard K8s technology
• Managed Kubernetes
• Integrated IAM security
• Versions 1.11-1.14
• Cloudformation support for cluster deployment
Co
nta
iners
source
AWS Batch
• Container support
• Queue based processing
• Priority levels
• Dynamic resource provisioning (event driven)
• Autoscaling
• Spot instances
• Multi-node parallel jobs for tightly-coupled HPC workloads
Co
nta
iners
Batch
Co
nta
iners
Managing containers
Co
nta
iners
Monitoring
Alerting
Logging
Operating functions
• Cloudwatch metrics
• Error-success rate
• Throttles
• Invocations
• Cloudwatch logs
• Function outputs, errors logged
• Monitor log patterns
• Dead letter queue
Serv
erl
ess
Src: aws.amazon.com
Operating functions
• Cloudwatch metrics
• Error-success rate
• Throttles
• Invocations
• Cloudwatch logs
• Function outputs, errors logged
• Monitor log patterns
• Dead letter queue
Serv
erl
ess
Src: aws.amazon.com
Summary
Serverless use cases
Lambda
• Asynchronous
• Lightweight (no or little local data processing)
• Quick execution (<15minutes)
• Usage varies from zero to large spikes
ECS with Fargate
• General workloads (local data processing below 10GB)
• Usage varies from zero to large spikes
Su
mm
ary
Container use cases
ECS & EKS
• Any container workload
• Standard Kubernetes (exit plan)
• Fixed minimum usage possibly with spikes or steady workloads
Batch
• Cheap processing (spot instances)
• Not real time execution
Su
mm
ary
Mixed use cases
Step functions
• Workflow needs
• Can integrate with Lambda, ECS and Batch and other services
• Combine purpose built services for their most efficient use cases
Su
mm
ary
Wrap up
• Know your workloads
• Use managed services
• Design the architecture with the right
tools&technologies
Su
mm
ary