Cloudflare Workers[1] is the most mature edge serverless platform available. It runs your JavaScript or WebAssembly code in 300+ global datacenters without managing regions, containers, or perceptible cold starts. Its architecture differs fundamentally from AWS Lambda, and that difference defines exactly where it shines and where it falls short.

Key takeaways

  • Workers uses V8 isolates instead of containers: 0-5 ms cold start vs Lambda’s 100 ms-2 s.

  • The edge storage stack (KV, Durable Objects, R2, D1) covers most needs without calling the origin.

  • JavaScript/TypeScript and WebAssembly are supported; Node.js modules with native bindings are not.

  • For edge logic, A/B testing, and smart proxies, Workers is the best option available.

  • For long CPU-intensive workloads or heavy npm dependencies, use Lambda or a traditional server.

The architecture: V8 isolates

AWS Lambda launches a container (or microVM like Firecracker) for each function, producing cold starts from 100 ms into the range of seconds. Workers uses V8 isolates, the same technology isolating tabs in Chrome. Consequences:

  • 0-5 ms cold start: creating an isolate is much cheaper than a container.

  • Low memory footprint; hundreds of Workers coexist in the same process.

  • Low cost per invocation; Cloudflare’s free tier is generous.

  • No OS APIs, native threads, or npm modules with native bindings.

For cases where the model fits, this is transformative. For cases where it doesn’t, it’s a blocker.

What you can run

Workers accepts:

  • Modern JavaScript ES Modules.

  • TypeScript (compiled to JS before deploy).

  • WebAssembly: Rust, Go (TinyGo), C, and AssemblyScript compiled to Wasm, ideal for CPU-intensive logic.

Does not accept:

  • Node.js modules with native C bindings (sharp, native bcrypt, etc.).

  • Local filesystem access.

  • Process spawning.

  • Listening on arbitrary TCP sockets (except permitted outbound).

WebAssembly logo, the binary format that extends Cloudflare Workers capabilities beyond pure JavaScript

Edge Storage: KV, Durable Objects, R2, and D1

Workers isn’t just compute. Cloudflare has built a complete edge storage stack:

Workers KV is a globally distributed key-value store, eventually consistent. Reads are fast and cached at every datacenter; writes propagate in seconds. Ideal for configuration, feature flags, and frequent response cache.

Durable Objects are objects with consistent, globally unique state. Each object lives in one datacenter and processes all requests for that instance sequentially. The right pattern for user sessions, chat rooms, and precise counters.

R2 is S3-compatible object storage without egress fees, a real advantage over S3 when serving content directly to the Internet.

D1 is a distributed SQLite database (maturing). It enables SQL queries for edge apps with reads from local replicas and writes to a primary region.

This combination covers most edge-application needs without calling a traditional origin.

Cases where Workers shines

The model fits perfectly for:

  • Frontend edge logic: smart routing, A/B testing, geo-based redirects, bot detection.

  • Custom API gateway: token validation, rate limiting, transforming requests before forwarding to origin.

  • Simple APIs without a traditional backend: light CRUD with KV or D1.

  • Streaming and response processing: transforming origin responses at the edge.

  • High-throughput webhooks: receiving bursts of requests per second at minimal cost.

  • Smart proxies: Workers in front of an origin adding cache, auth, and telemetry.

Cases Where It Is Not the Tool

  • APIs with heavy npm dependencies: Workers doesn’t support large parts of the native Node ecosystem.

  • Long CPU-intensive workloads: CPU-time limits per request apply.

  • Long-running tasks: Workers are designed to respond fast, not for long processes.

  • Strong transactional data: KV is eventually consistent; ACID guarantees are weaker than Postgres.

  • Complex stateful workloads: Durable Objects help but don’t solve everything.

Aspect Workers AWS Lambda Vercel/Netlify
Cold start ~0-5 ms 100 ms-2 s Similar to Lambda
Global distribution 300+ datacenters Per AWS region Edge in some cases
Languages JS/TS/Wasm Almost all Mostly JS/TS
Edge storage built-in Yes No Limited
Full Node.js support Limited Complete Complete

Development Workflow

Cloudflare has invested in developer experience. The wrangler CLI manages the full cycle: wrangler dev runs local development with hot reload and KV/Durable Objects simulation; deploy takes seconds; wrangler tail shows live logs. The iteration loop is much faster than deploying Lambda + API Gateway + IAM + CloudFront.

Related: if your architecture combines Workers with Kubernetes on the backend, the service mesh guide is relevant. And for security in the pipeline building and deploying Workers, Sigstore and cosign cover artifact signing.

This article explains the execution model. For where the platform stands today, continue with Cloudflare Workers in 2025.

Conclusion

Cloudflare Workers has consolidated edge serverless as a mature category. For cases fitting the model (JavaScript or WebAssembly, short logic, edge storage), it is the best available option: faster, cheaper, and more distributed than alternatives. For cases that don’t fit, don’t force the model. The key is identifying when the edge adds value and when a traditional server or Lambda is still the right answer.

Frequently asked questions

Can I use any npm package in Cloudflare Workers?

No. Workers runs modern JavaScript ES Modules, TypeScript compiled to JS and WebAssembly (Rust, Go via TinyGo, C and AssemblyScript). What it does not accept: Node.js modules with native C bindings such as sharp or native bcrypt, local filesystem access, process spawning or listening on arbitrary TCP sockets. If your API depends on large parts of the native Node ecosystem, Lambda or a traditional server is still the right answer.

How long is a Worker's cold start compared with AWS Lambda?

Between 0 and 5 ms, versus the 100 ms to seconds range for Lambda. The gap comes from the architecture: Lambda launches a container or a Firecracker-style microVM per function, while Workers uses V8 isolates, the same technology that isolates tabs in Chrome. Creating an isolate is much cheaper, the memory footprint is low and hundreds of Workers coexist in the same process.

Which edge storage option should I use for sessions, feature flags or files?

It depends on the consistency you need. Workers KV is an eventually consistent key-value store, with reads cached at every datacenter and writes propagating in seconds: good for configuration, feature flags and frequent response caching. Durable Objects give consistent, globally unique state, the right pattern for user sessions, chat rooms and precise counters. R2 is S3-compatible object storage without egress fees, and D1 is a distributed SQLite database that is still maturing.

Sources

  1. Cloudflare Workers