[ SRE_ARENA ]
SERVERLESS (LAMBDA)

Serverless: Lambda & API Gateway

DOWNLOADING CONCEPT: 1. THE SERVERLESS PARADIGM...
  • ↳For a decade, the cloud was just 'renting someone else's computer' (EC2).
  • ↳You still had to patch Ubuntu, manage scaling, and pay for the server even when no users were visiting your site at 3 AM.
Serverless
  • ↳changed everything.
  • ↳With AWS Lambda, you don't provision servers.
  • ↳You just write a function in Node.js or Python, upload it, and AWS runs it.
  • ↳You are billed purely by the millisecond of execution time.
  • ↳If you have zero traffic, you pay $0.00.
  • ↳If you get 10,000 requests in a second, AWS instantly spins up 10,000 copies of your function.
▲ LIVE INCIDENTA developer deployed a Node.js Lambda function that connects to an external API. Every single request takes exactly 3.0 seconds to execute, which is driving up the AWS bill. The external API claims their response time is 50ms.
sre@arena:~/cloud-lambda
sre@arena:~$ cat index.js