02 Faas Concepts
DodaTech
1 min read
title: FaaS Concepts for Serverless API Development weight: 12 date: 2026-06-28 lastmod: 2026-06-28 description: Understand Function-as-a-Service core concepts including stateless functions, cold starts, execution duration limits, event sources, and function lifecycle management. tags: [api-development, serverless]
FaaS (Function-as-a-Service) runs stateless functions triggered by events, with each invocation running in an isolated container, limited to 15-minute execution duration, 128MB-10GB memory, and ephemeral storage that resets between calls.
```python
# Basic AWS Lambda handler
import json
def lambda_handler(event, context):
# event: Trigger event data (API Gateway request, S3 notification, etc.)
# context: Runtime information (function name, remaining time, request ID)
print(f"Function {context.function_name} invoked")
print(f"Request ID: {context.aws_request_id}")
# Parse API Gateway event
http_method = event.get("httpMethod", "GET")
path = event.get("path", "/")
body = json.loads(event.get("body", "{}")) if event.get("body") else {}
return {
"statusCode": 200,
"headers": {"Content-Type": "application/json"},
"body": json.dumps({
"message": f"Processed {http_method} {path}",
"input": body
})
}
What's Next
Now learn about AWS Lambda setup in Building Serverless APIs.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro