βΆLambda vs containers (ECS/Fargate) β when do I pick which?
Lambda: bursty/event-driven, < 15-min execution, < 10GB memory, idempotent. Pay only for invocations. Fargate/ECS: long-running, custom runtimes, sustained throughput, > 15-min jobs, persistent connections. Cost crossover: roughly 1M invocations/day or 24/7 traffic = containers win. Most modern apps use both: Lambda for triggers/glue, containers for core services.
βΆHow do I handle the cold-start problem?
Provisioned Concurrency (keeps N instances warm, costs ~$5/instance/month) for latency-sensitive endpoints. Lambda SnapStart (Java/Python/.NET) reduces cold starts 10x at no extra cost. Keep deployment package small (< 50MB unzipped). Prefer ARM Graviton2 (faster cold starts, 20% cheaper). For < 100ms p99 SLA: use Provisioned Concurrency on critical paths only.
βΆLambda vs Cloudflare Workers vs Vercel Functions β what's the difference?
Lambda: deepest AWS integration, most languages, 15-min timeout, regional. Cloudflare Workers: edge (300+ POPs), V8 isolates, sub-ms cold start, but limited (no native Node), 30-sec CPU. Vercel Functions: developer-friendly Next.js integration, runs on Lambda or Edge. For AWS-heavy stacks: Lambda. For ultra-low-latency global APIs: Workers. For Next.js apps: Vercel Functions.
βΆHow do I deploy Lambda properly β console, SAM, CDK, or Serverless Framework?
Never console for production. SAM is AWS-native, lightweight, YAML-based, good for simple Lambda+API Gateway+DynamoDB setups. CDK is full IaC with TypeScript/Python, scales to large apps with reusable constructs β preferred for complex orgs. Serverless Framework is multi-cloud and has the best plugin ecosystem but adds a layer of abstraction. CDK is the 2026 default for new AWS projects.
βΆHow does Lambda pricing actually work?
Two parts: (1) requests: $0.20 per 1M invocations, (2) compute: $0.0000166667 per GB-second. A 512MB function running 100ms costs ~$0.000001 per invocation. For 1M invocations Γ 100ms Γ 512MB = ~$1 + $0.20 = $1.20/month. Free tier: 1M req + 400k GB-sec/month forever. For most startups, Lambda costs are negligible until you hit > 100M invocations/month.
βΆWhat languages should I use with Lambda in 2026?
Python (best ecosystem, easiest to learn) and Node.js/TypeScript (largest community, fastest cold start) are tier 1. Go for performance + small binaries. Rust for max performance + min cold start (via custom runtime or Lambda Web Adapter). Java is supported but cold starts are painful β use SnapStart. Python and TypeScript cover 90% of jobs.
βΆHow do I monitor and debug Lambda in production?
CloudWatch Logs for output (default). CloudWatch Metrics for invocation count, duration, errors. AWS X-Ray for distributed tracing across services. Lambda Powertools (per language) for structured logging + tracing + metrics. Datadog/New Relic for cross-account observability if you have multi-region/multi-account. Set CloudWatch alarms on error rate, throttles, and duration p99 from day one.