After bringing several Serverless applications to production using Amazon Web Services (AWS Lambda), I decided to share some things I picked up. This presentation is currently still a draft.
● Move state to global variables ● Fail fast ● Connections - Shorter server-side connection timeouts - Client side connection pool to 1 - Connections keep-alive & auto reconnect Optimize execution time
✅ Access to Amazon RDS, Elasticache, RedShift, … ✅ Private API Gateway ✅ On-premise services over VPN When to use a VPC? ❌ Elastic Network Interface (ENI) increases cold start ❌ Limited number of ENIs per VPC ❌ NAT Gateway are required for Internet Access
● Local development - Serverless - aws-sam-cli ● Separate Lambda handler from business logic ● Use Environment Variables - … learn to love SSM Parameter Store Development tips
● AWS Lambda: $0.20 per million requests $0.00001667 per GB-second ● API Gateway: $3.50 per million API calls ● SQS: $0.40 per million requests ● DynamoDB: $0.25 per GB-month Stream triggers to Lambda free ● Kinesis*: $0.015 per shard per hour $0.014 per million PUT requests Pricing* NOTE: Prices vary per region + Free tier
Get started! Amazon Web Services — a practical guide https://github.com/open-guides/og-aws AWS Certification preparation https://bit.ly/2aroFYb Serverless framework https://serverless.com AWS Well-Architected https://aws.amazon.com/architecture/well-architected AWS re:Invent 2017: Become a Serverless Black Belt https://www.youtube.com/watch?v=oQFORsso2go