4.1 AWS Lambda: Functions as a Service
Lambda: upload code → runs on demand → pay only for execution time (millisecond billing). Runtimes: Python, Node.js, Java, Go, .NET. Triggers: API Gateway (HTTP), S3 (file upload), DynamoDB Streams, SQS, EventBridge. Memory: 128MB–10GB (more memory = more CPU). Cold starts: first invocation is slower. Concurrency: automatic scaling. Lambda Layers for shared libraries. "Process 10,000 images without provisioning a single server" — the serverless promise.
4.2 API Gateway + Lambda: Serverless APIs
API Gateway: create REST/HTTP APIs that invoke Lambda. Resource-based routes: /users, /products/{id}. Request validation, throttling, API keys. Stages: dev, staging, prod. CORS configuration. WebSocket APIs for real-time. Building a complete serverless REST API: API Gateway → Lambda → DynamoDB — zero servers to manage. The architecture pattern powering most serverless applications.
4.3 Event-Driven Architecture
SQS (Simple Queue Service): message queue for decoupling services (producer → queue → consumer). SNS (Simple Notification Service): pub/sub for fan-out (one event → multiple consumers). EventBridge: event bus for routing events between services. Step Functions: orchestrate multi-step workflows (order processing: validate → charge → ship → notify). Event-driven = loosely coupled, scalable, resilient. The architecture pattern behind modern cloud-native applications.
4.4 Serverless Patterns & Limitations
Patterns: API backend (API Gateway + Lambda + DynamoDB), file processing (S3 upload → Lambda → transform → save), scheduled tasks (EventBridge rule → Lambda), stream processing (Kinesis/DynamoDB Streams → Lambda). Limitations: 15-minute max execution, cold starts (mitigated with Provisioned Concurrency), vendor lock-in, debugging complexity. When serverless fits (event-driven, variable load, quick MVPs) vs when containers are better (long-running, predictable load, complex orchestration).
Placement relevance: "Design a serverless architecture for this use case" is asked at every AWS-focused company. Lambda + API Gateway + DynamoDB is the most common serverless pattern. Understanding SQS vs SNS vs EventBridge is tested in every AWS certification. Serverless is the fastest-growing deployment model — companies like Netflix, Airbnb, and Coca-Cola use it extensively.