Docker vs Podman
Docker versus Podman: container daemon architecture, security (rootless), tooling, ecosystem, and migration story for production container workflows.
Compute that runs on the global edge with V8 isolates, with no VM cold starts
Serverless compute running on Firecracker microVMs, deeply integrated with the AWS ecosystem
There's no outright winner: for short, latency-sensitive, globally distributed request handling (auth, routing, personalization, API gateways, webhooks), Cloudflare Workers is both cheaper and has less cold-start friction. For long-running, memory-heavy work or jobs that depend on VPC-bound AWS resources, Lambda leads: its ceilings are higher and private-network access is GA — Workers' equivalent is still in beta. The most common production pattern is hybrid: Workers as a thin edge layer, Lambda handling the heavy lifting behind it.
| Category | Cloudflare Workers | AWS Lambda |
|---|---|---|
| Performance | 8/10 | 7/10 |
| Ease of Learning | 7/10 | 6/10 |
| Ecosystem | 6/10 | 9/10 |
| Community | 6/10 | 8/10 |
| Job Market | 6/10 | 8/10 |
| Future-Proof | 9/10 | 8/10 |
// Cloudflare Workers - API connecting to Postgres via Hyperdrive
import { Hono } from "hono";
import postgres from "postgres";
interface Env {
HYPERDRIVE: Hyperdrive;
}
const app = new Hono<{ Bindings: Env }>();
app.get("/api/users/:id", async (c) => {
// Opening a new client on every request is cheap — Hyperdrive
// already pools connections on the platform side.
const sql = postgres(c.env.HYPERDRIVE.connectionString, {
max: 5,
fetch_types: false,
});
// Hyperdrive cleans up the connection itself when the request ends; no need to call sql.end().
const id = c.req.param("id");
const rows = await sql`
SELECT id, name, plan FROM users WHERE id = ${id} LIMIT 1
`;
if (rows.length === 0) {
return c.json({ error: "not_found" }, 404);
}
return c.json(rows[0]);
});
export default app;
/*
wrangler.jsonc
{
"name": "edge-api",
"main": "src/index.ts",
"compatibility_date": "2026-09-01",
"hyperdrive": [
{ "binding": "HYPERDRIVE", "id": "<hyperdrive-config-id>" }
]
}
*/// AWS Lambda (Node.js) - handler connecting to RDS Postgres inside a VPC
import { Client } from "pg";
let client; // persists across container reuse (warm start)
export const handler = async (event) => {
const id = event.pathParameters?.id;
if (!client) {
client = new Client({
host: process.env.DB_HOST, // RDS private endpoint (inside the VPC)
port: 5432,
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
ssl: { rejectUnauthorized: true },
});
await client.connect();
}
try {
const result = await client.query(
"SELECT id, name, plan FROM users WHERE id = $1 LIMIT 1",
[id]
);
if (result.rows.length === 0) {
return { statusCode: 404, body: JSON.stringify({ error: "not_found" }) };
}
return { statusCode: 200, body: JSON.stringify(result.rows[0]) };
} catch (err) {
console.error(err);
return { statusCode: 500, body: JSON.stringify({ error: "internal" }) };
}
};
/*
template.yaml (AWS SAM) — VPC + memory + timeout
Resources:
UsersFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs22.x
MemorySize: 512
Timeout: 15 # seconds (ceiling 900 = 15 min)
VpcConfig:
SecurityGroupIds: [sg-xxxxxxxx]
SubnetIds: [subnet-xxxxxxxx, subnet-yyyyyyyy]
Policies:
- VPCAccessPolicy: {}
*/There's no outright winner: for short, latency-sensitive, globally distributed request handling (auth, routing, personalization, API gateways, webhooks), Cloudflare Workers is both cheaper and has less cold-start friction. For long-running, memory-heavy work or jobs that depend on VPC-bound AWS resources, Lambda leads: its ceilings are higher and private-network access is GA — Workers' equivalent is still in beta. The most common production pattern is hybrid: Workers as a thin edge layer, Lambda handling the heavy lifting behind it.
Get Free ConsultationIt depends — you need to run the numbers for your workload. The Workers Paid plan is $5/month base, including 10M requests and 30M CPU-ms, with overages at $0.30/million requests + $0.02/million CPU-ms; I/O wait time is free. Lambda charges per request plus GB-seconds (memory × duration), and its free tier includes 1M requests + 400,000 GB-seconds/month. For short, I/O-heavy work, Workers' CPU-time model can come out cheaper; for long, CPU-intensive work, Lambda's GB-second model varies by workload.