Guide
Best Edge Runtime Frameworks in 2026



Hono, Cloudflare Workers, and Vercel Edge compared for edge computing. V8 isolate performance, cold starts, and which edge framework fits your use case in 2026.
Contents
Contents
TL;DR
Choose Hono on Cloudflare Workers for a standalone edge API. Hono is the routing framework and Workers is the host. Hono's routing code can also run on Deno, Bun, and Node.js with the appropriate entry point. Hono runtime support
For a Next.js app on Vercel, routes and pages use Node.js from Next.js 16.3 onward. Proxy also defaults to Node.js under its own runtime rules. Vercel route runtime · Next.js Proxy
Key Takeaways
- Cloudflare Workers runs application code in V8 isolates.
- Hono provides routing and middleware built around web-standard requests and responses.
- Vercel Edge supports a subset of the Node.js APIs. Check that your deployment and dependencies support it before moving a function.
- Deno Deploy — Deno-native serverless edge, TypeScript-first
- Cold starts. Compare end-to-end cold and warm request latency with the same payload, dependencies, and upstream services.
Hono (Multi-Runtime Edge Framework)
// Hono — works on Cloudflare Workers, Deno, Bun, Node.js
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { logger } from 'hono/logger';
import { zValidator } from '@hono/zod-validator';
import { z } from 'zod';
const app = new Hono();
// Middleware
app.use('*', logger());
app.use('/api/*', cors({
origin: ['https://app.example.com'],
allowMethods: ['GET', 'POST', 'PUT', 'DELETE'],
}));
// Routes with Zod validation
const createUserSchema = z.object({
name: z.string(),
email: z.string().email(),
});
app.post('/api/users', zValidator('json', createUserSchema), async (c) => {
const body = c.req.valid('json'); // Typed from schema
const user = await createUser(body);
return c.json({ user }, 201);
});
app.get('/api/packages/:name', async (c) => {
const { name } = c.req.param();
const pkg = await fetchPackageData(name);
if (!pkg) {
return c.json({ error: 'Package not found' }, 404);
}
// Cache response at edge
return c.json(pkg, {
headers: {
'Cache-Control': 'public, max-age=60', // 60s CDN cache
'CDN-Cache-Control': 'max-age=3600', // 1hr at edge
},
});
});
export default app;
// Hono on Cloudflare Workers — with KV and D1
import { Hono } from 'hono';
type Bindings = {
MY_KV: KVNamespace;
DB: D1Database;
CACHE: KVNamespace;
};
const app = new Hono<{ Bindings: Bindings }>();
app.get('/api/user/:id', async (c) => {
const id = c.req.param('id');
// Check KV cache first
const cached = await c.env.CACHE.get(`user:${id}`, 'json');
if (cached) return c.json(cached);
// Query D1 (SQLite at the edge)
const result = await c.env.DB.prepare(
'SELECT id, name, email FROM users WHERE id = ?'
).bind(id).first();
if (!result) return c.json({ error: 'Not found' }, 404);
// Cache for 5 minutes
await c.env.CACHE.put(`user:${id}`, JSON.stringify(result), {
expirationTtl: 300,
});
return c.json(result);
});
export default app;
// Hono — RPC client (type-safe, like tRPC for REST)
import { Hono } from 'hono';
import { hc } from 'hono/client';
const app = new Hono()
.get('/api/users/:id', async (c) => {
return c.json({ id: c.req.param('id'), name: 'Alice' });
});
export type AppType = typeof app;
// Client — fully typed without code generation
const client = hc<AppType>('https://api.example.com');
const user = await client.api.users[':id'].$get({ param: { id: '123' } });
const data = await user.json();
// data.name — TypeScript knows it's a string
Cloudflare Workers (V8 Isolates)
// Cloudflare Workers — direct (no Hono)
// src/index.ts
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url);
if (url.pathname === '/api/health') {
return Response.json({ status: 'ok', region: request.cf?.region });
}
if (url.pathname.startsWith('/api/packages/')) {
const name = url.pathname.slice('/api/packages/'.length);
// R2 storage (object storage)
const cached = await env.PACKAGE_CACHE.get(name);
if (cached) {
return new Response(cached, {
headers: { 'Content-Type': 'application/json', 'X-Cache': 'HIT' },
});
}
const data = await fetchFromNpm(name);
ctx.waitUntil(env.PACKAGE_CACHE.put(name, JSON.stringify(data), {
expirationTtl: 3600,
}));
return Response.json(data);
}
return new Response('Not Found', { status: 404 });
},
} satisfies ExportedHandler<Env>;
# wrangler.toml — Cloudflare Workers config
name = "my-api"
main = "src/index.ts"
compatibility_date = "2024-12-01"
# KV namespace
kv_namespaces = [
{ binding = "PACKAGE_CACHE", id = "abc123" }
]
# D1 database
[[d1_databases]]
binding = "DB"
database_name = "my-database"
database_id = "xyz789"
# Environment variables
[vars]
ENVIRONMENT = "production"
Vercel Edge Runtime
The older Next.js Edge route setting applies only where the framework and host support it. For Next.js 16.3 and later on Vercel, use a Node.js Route Handler and await dynamic route params.
// app/api/packages/[name]/route.ts
export async function GET(
_request: Request,
{ params }: { params: Promise<{ name: string }> }
) {
const { name } = await params;
const url = `https://registry.npmjs.org/${encodeURIComponent(name)}/latest`;
const upstream = await fetch(url);
if (!upstream.ok) {
const status = upstream.status === 404 ? 404 : 502;
return Response.json({ error: 'Package lookup failed' }, { status });
}
const pkg = await upstream.json();
return Response.json({ name: pkg.name, version: pkg.version });
}
For redirects and rewrites before route handling, use proxy.ts on Next.js versions with Proxy. It uses Node.js and has no runtime setting. Keep authorization checks in the route or page that serves the protected data.
Performance Comparison
| Platform | What to measure | Billing inputs to compare |
|---|---|---|
| Cloudflare Workers | Isolate startup, response latency, and time spent on upstream calls | Plan subscription, requests, and CPU time |
| Vercel Edge, where supported | Function startup and response latency in the deployed configuration | Fluid compute plan, active CPU, provisioned memory, and invocations |
| AWS Lambda | Initialization and invocation latency in the selected region | Requests and compute duration at the configured memory |
| AWS Lambda@Edge | Response latency on the chosen CloudFront event | Requests and compute duration for Lambda@Edge |
Use the same workload to compare platforms. Apply the billing model for the actual plan and region. Workers pricing · Vercel Functions pricing · AWS Lambda pricing
When to Choose
| Scenario | Pick |
|---|---|
| Standalone API close to users | Hono on Cloudflare Workers |
| Redirects or rewrites in a Next.js app using Proxy | Next.js Proxy on Node.js |
| Next.js 16.3 or later on Vercel | Node.js route or page |
| Geo-routing, A/B testing at edge | Cloudflare Workers |
| Multi-runtime app (CF + Deno + Bun) | Hono |
| SQLite at the edge (D1) | Cloudflare Workers + Hono |
| Global KV storage | Cloudflare Workers (KV) |
Developer Experience and Debugging
Edge runtime debugging is more constrained than traditional Node.js development. Because V8 isolates omit the full Node.js API surface, tools that rely on Node.js internals (native addons, fs, child_process, crypto via node:crypto) fail silently or throw at runtime. The most common edge runtime pitfall is discovering a dependency's transitive dependency uses a Node.js built-in that is not available in the Cloudflare Workers or Vercel Edge environment.
Cloudflare's local development tooling (wrangler dev) runs a local V8 isolate that closely matches the production environment, including the same API restrictions. This makes local testing reliable — if it works with wrangler dev, it works in production. Wrangler also supports --remote mode, which tunnels requests to a real Cloudflare Worker for testing against actual KV, D1, and R2 infrastructure.
Use next dev to test the Next.js Route Handler locally. For an existing Edge function outside this workflow, check runtime support and dependencies against the deployment target.
Hono's testing utilities include a test client that calls handlers in-process without HTTP overhead, making unit tests fast regardless of deployment target. The same handler code can be tested locally with Node.js APIs (for non-edge code paths) and with the edge-compatible test client for edge-specific routes.
Choosing an edge runtime also means accepting limited observability. Traditional APM tools (Datadog, New Relic) require separate SDKs for edge environments, and log access in Cloudflare Workers requires subscribing to Cloudflare's Logpush service. Vercel provides built-in function logs in the dashboard, which simplifies observability for simple use cases.
Cold Start Economics and V8 Isolate Advantages
Cloudflare Workers runs code in V8 isolates. AWS Lambda initializes an execution environment when it needs a new one. Measure the first response after initialization separately from warm requests. Include upstream calls, which can dominate end-to-end latency. Check runtime support before moving work that depends on Node.js native addons or filesystem access.
Data Access Patterns at the Edge
An edge function still has to reach your database. A Worker close to a user can spend much of its response time waiting on a query to a distant Postgres region. Measure where requests spend time. Cache responses in a Worker when the data can be cached, test Hyperdrive connection pooling for a regional database, or run data-heavy handlers near the database.
TypeScript Integration and Type-Safe Edge APIs
Hono's RPC client feature is one of the most compelling TypeScript integration stories in the edge runtime space. By exporting the Hono app type (export type AppType = typeof app), client code can import this type and use hc<AppType>(baseUrl) to get a fully type-safe HTTP client without any code generation step. Route parameters, query parameters, request bodies (validated with Zod), and response shapes are all inferred from the server type definition — changing the server API automatically surfaces as TypeScript errors in the client code. This pattern is comparable to tRPC but for REST APIs with HTTP semantics. Cloudflare Workers TypeScript support has matured significantly with the @cloudflare/workers-types package, which provides accurate types for all Cloudflare bindings (KV, D1, R2, Durable Objects, Service Bindings). The Env interface pattern (defining all binding types in an interface that the Worker handler receives) gives end-to-end type safety for reading environment variables and accessing platform APIs.
Vendor Lock-In and Multi-Runtime Portability
Choosing Cloudflare Workers means accepting meaningful vendor lock-in: KV, D1, R2, and Durable Objects are Cloudflare-specific APIs that do not transfer to other platforms. If you later decide to move to Vercel, AWS, or another provider, code that uses Cloudflare KV or D1 must be rewritten against the new platform's equivalents. Hono partially mitigates this by providing a runtime-agnostic application layer — Hono apps can run on Cloudflare, Deno, Bun, and Node.js with the same application code. But data access code that uses Cloudflare bindings is not portable regardless of which HTTP framework wraps it. Vercel Edge is similarly tied to Vercel's platform, though it uses Next.js conventions that have broader ecosystem support. Teams prioritizing portability should design their edge functions to interact with standards-based APIs — HTTP fetch for external services, SQL over standard connection strings for databases — and isolate platform-specific code in adapter layers that can be replaced without rewriting business logic.
Evaluating Edge Runtimes for Your Architecture
Test a request from near your users and another from near your origin. Hono on Workers fits routing and cacheable responses that can run close to users. If each request needs a regional database, compare the edge path with a Node.js service near that database before committing to a runtime.
Compare edge framework package health on PkgPulse.
See also: Fastify vs Hono and Express vs Hono, Best npm Packages for Edge Runtimes in 2026.