Is Serverless Always Cheaper?
No! At high scale, a container (ECS/Fargate) can be cheaper than a Lambda.
Optimization for Lambda
- Memory Tuning: Sometimes adding more memory makes the function faster and cheaper because it finishes sooner.
- Cold Starts: How to avoid paying for Provisioned Concurrency unless necessary.