Cloudflare Workers vs AWS Lambda — which serverless platform for APIs?
Decide between Cloudflare Workers and AWS Lambda for latency-sensitive APIs given current runtime limits, networking constraints, durable state options, observability tooling, and pricing changes.
Blockers
- requires_version: capability/aws-lambda-snapstart → runtime/java
- requires_version: capability/aws-lambda-snapstart → runtime/python
- requires_version: capability/aws-lambda-snapstart → runtime/dotnet
- breaking_change_in: capability/cloudwatch-tiered-pricing-for-lambda-logs → framework/aws-lambda
Who this is for
- serverless
- high-scale
- low-ops
- cost-sensitive
- enterprise
- small-team
- real-time
- compliance
Candidates
Cloudflare Workers
Edge-first isolate runtime for globally distributed APIs with very low user-to-compute latency. As of 2026-03-14, Workers Paid uses the Standard pricing model by default: $5/month minimum, 10M included requests then $0.30/million, and 30M included CPU ms then $0.02/million; HTTP duration has no hard limit while the client stays connected, but CPU time is 10 ms on Free and defaults to 30s on Paid, configurable up to 5 minutes.
When to choose
Choose this for latency-sensitive public APIs, request/response transforms, auth gateways, geo-distributed personalization, and small-team + low-ops + serverless setups where global edge placement matters more than deep VPC integration. Best fit when you want state close to users via Durable Objects, can work within a V8/isolate model, and do not need private subnet access or heavyweight Node/container assumptions.
Tradeoffs
Strong global latency profile and simple edge deployment. Durable Objects give transactional strongly consistent per-object state, while KV is eventually consistent and better for read-heavy caches/config; D1 adds serverless SQLite-style relational storage. Built-in logs, traces, metrics, Tail Workers, and OTLP export reduce observability setup. Networking is more constrained than Lambda: only six simultaneous outbound connections per top-level request, and there is no AWS-style VPC attachment model for reaching private subnets.
Cautions
Do not assume full Node.js or traditional server semantics. Legacy Bundled/Unbound plans are deprecated for new accounts, Durable Objects add separate request/duration/storage billing, and KV propagation can take 60 seconds or more across locations. If your API depends on private VPC resources, long-lived TCP-heavy fan-out, or libraries that expect unrestricted Node/container behavior, validate those assumptions early.
AWS Lambda
Regional serverless compute with broad AWS integration and stronger private-network/compliance options than edge-isolate platforms. As of 2026-03-14, Lambda pricing remains request-plus-duration based with 1M free requests and 400,000 GB-seconds per month in the free tier; request pricing is $0.20 per million, while total cost also depends on memory, duration, architecture, region, and optional features such as Provisioned Concurrency and logging.
When to choose
Choose this for latency-sensitive APIs that must live inside AWS, need VPC access to RDS/ElastiCache/private services, or require enterprise + compliance + serverless constraints with mature IAM, networking, and service integrations. Best fit when regional latency is acceptable or you can pay for cold-start mitigation, and when durable state should live in external services such as DynamoDB, S3, SQS, EFS, or other AWS data planes rather than inside the function runtime.
Tradeoffs
Lambda is stateless by design, scales deeply inside AWS, and supports up to 15-minute execution with default regional concurrency of 1,000 and higher by quota increase. Observability is richer but more composable: CloudWatch metrics/logs, X-Ray, Lambda Insights, and Application Signals are available, but they add more moving parts and cost surfaces than Workers' integrated platform view. For cold-start-sensitive APIs, Provisioned Concurrency can deliver double-digit millisecond startup, while SnapStart helps supported runtimes such as Java 11+, Python 3.12+, and .NET 8+.
Cautions
Attaching a function to a VPC changes its network behavior: by default Lambda has public internet access, but once attached it can only reach resources in that VPC unless you configure internet egress such as NAT. Provisioned Concurrency adds separate charges, SnapStart does not support Node.js runtimes such as nodejs24.x, and CloudWatch observability is billed separately; Lambda logs have used CloudWatch's tiered pricing model since May 1, 2025, with S3 and Firehose delivery options available.
Sources
- aws.amazon.com/lambda/pricing/
- docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html
- docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
- docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html
- docs.aws.amazon.com/lambda/latest/dg/snapstart.html
- docs.aws.amazon.com/lambda/latest/dg/lambda-monitoring.html
- docs.aws.amazon.com/lambda/latest/dg/monitoring-application-signals.html
- docs.aws.amazon.com/lambda/latest/dg/concepts-application-design.html
- aws.amazon.com/about-aws/whats-new/2025/05/amazon-cloudwatch-tiered-pricing-additional-destinations-aws-lambda-logs/
Try with your AI agent
$ npm install -g pocketlantern $ pocketlantern init # Restart Claude Code, Cursor, or your MCP client, then ask: # "Cloudflare Workers vs AWS Lambda — which serverless platform for APIs?"