3.1.2.3. Serverless Architectures for Scalability
3.1.2.3. Serverless Architectures for Scalability
Serverless eliminates capacity planning — the platform scales to zero when idle and handles thousands of concurrent requests without configuration.
AWS serverless compute:
- Lambda: Functions scale automatically (up to 1,000 concurrent by default, can request increase to tens of thousands). Pay per invocation and execution duration.
- Fargate: Container workloads without managing EC2 instances. ECS/EKS scheduler places tasks on managed infrastructure.
Serverless supporting services:
- API Gateway: Routes HTTP requests to Lambda, ECS, or other backends. Handles authentication, rate limiting, caching.
- DynamoDB: On-demand mode scales read/write capacity automatically. No table management.
- S3: Unlimited object storage with built-in scaling.
- SQS/SNS/EventBridge: Fully managed messaging with no capacity planning.
Serverless scaling characteristics:
| Service | Scale Unit | Limit | Cold Start |
|---|---|---|---|
| Lambda | Concurrent executions | 1,000 default (soft limit) | 100ms-10s depending on runtime |
| API Gateway | Requests/second | 10,000 default | None |
| DynamoDB On-Demand | Read/Write capacity units | Doubles previous peak within 30 min | None |
Provisioned concurrency pre-initializes Lambda execution environments to eliminate cold starts. Use for latency-sensitive APIs where cold start delays are unacceptable.
Exam Trap: Lambda concurrent execution limits are per-region per-account. If one function consumes all 1,000 concurrent executions, other functions in the same account/region are throttled. Use reserved concurrency to guarantee capacity for critical functions and prevent noisy-neighbor problems.
Lambda + relational databases: every concurrent execution environment opens its own database connection, and environments don't share connection pools — so 1,000 concurrent invocations can exhaust max_connections. RDS Proxy pools and multiplexes those connections, avoiding both a bigger database and a concurrency cap that would throttle the function.