Skip to main content
>_ supraj.dev
TOPIC CLOUD
Serverless run code without provisioning or managing servers
IN 10 SECONDS

You upload a function (AWS Lambda, GCP Cloud Functions) or a container (Cloud Run), and the platform handles scaling, availability, and patching. You're charged per invocation and compute duration — zero cost when idle. The function is stateless and limited to a maximum execution timeout (usually 15 minutes for Lambda, 60 for Cloud Run).

GOTCHA Cold starts happen when a new execution environment is needed. For latency-sensitive paths, use Provisioned Concurrency (Lambda) or min-instances (Cloud Run) — but they cost money even when idle.
HOW A LAMBDA INVOCATION FLOWS
01 Trigger an S3 upload, an API Gateway HTTP request, or an SQS message invokes the function.
02 Lambda service finds or creates an execution environment (sandbox) with the configured memory and runtime.
03 Lambda runtime downloads your code from S3, initializes the runtime (Python, Node, Go, etc.), and runs the handler outside the init phase.
04 Your handler receives the event payload and context object (request ID, deadline, etc.). Returns a response or throws an error.
05 Platform freezes the environment for reuse (warm start) or tears it down after inactivity (~5–15 minutes).
POKE IT YOURSELF
aws lambda invoke --function-name my-fn response.json — invoke a Lambda synchronously
aws lambda list-functions — list all Lambda functions in the region