lambda Flashcards
EC2 vs Lambda
EC2 Virtual Servers in the Cloud • Limited by RAM and CPU • Continuously running • Scaling means intervention to add/remove servers
Lambda • Virtual functions – no servers to manage! • Limited by time - short executions • Run on-demand • Scaling is automated!
Lambda Limits
• Execution:
Memory allocation: 128 MB – 10GB (64 MB increments)
Maximum execution time: 900 seconds (15 minutes)
Environment variables (4 KB)
Disk capacity in the “function container” (in /tmp): 512 MB
Concurrency executions: 1000 (can be increased)
• Deployment:
Lambda function deployment size (compressed .zip): 50 MB
Size of uncompressed deployment (code + dependencies): 250 MB
Can use the /tmp directory to load other files at startup
Size of environment variables: 4 KB
lambda@edge has 4 functions(Picture mentioned in slide number 444 of Stephan)
Viewer request ->
After CloudFront receives a request from a viewer
Origin request ->
Before the request hits the origin layer.
Origin response ->
After CloudFront receives the response from the origin
Viewer Response ->
Before CloudFront forwards the response to the viewer(hits the viewer layer)
Lambda@Edge: Use Cases
Website Security and Privacy Dynamic Web Application at the Edge Search Engine Optimization (SEO) Intelligently Route Across Origins and Data Centers Bot Mitigation at the Edge Real-time Image Transformation A/B Testing User Authentication and Authorization User Prioritization User Tracking and Analytics