Skip to content

SYSTEM Cited by 1 source

Vercel Edge Functions

Vercel Edge Functions are Vercel's V8-isolate-based serverless runtime. They execute JavaScript / TypeScript code on Vercel's global edge network, next to the user rather than at a single origin region. Built on the Edge Runtime — a restricted subset of Node.js / web-platform APIs where only fetch()-class HTTP egress is permitted; raw TCP / UDP sockets from user code are not supported.

Why it shows up on this wiki

First-class example of a runtime that cannot speak raw database protocols — it can only speak HTTP. One of the launch targets for the PlanetScale serverless driver for JavaScript: "The ability to store and query data in PlanetScale from environments such as Cloudflare Workers, Vercel Edge Functions, and Netlify Edge Functions." (Source: sources/2026-04-21-planetscale-introducing-the-planetscale-serverless-driver-for-javascript.)

Structurally similar to:

All three force the same database-access pattern: patterns/http-api-alongside-binary-protocol + Fetch-API client.

Key properties

  • Runtime: V8 isolates with a standards-based web API surface (fetch, Request, Response, Web Streams, crypto, etc.). Not Node.js — only a subset of Node-compatible APIs are polyfilled.
  • Egress: HTTPS only. Raw TCP is not available to user code (concepts/serverless-tcp-socket-restriction).
  • Deployment geography: executes at the nearest Vercel edge POP to the user; no region pinning.
  • Tight coupling with Next.js: the primary use case is Next.js middleware + server components + API routes that use the edge runtime option. Can also be used standalone as /api/* routes.

Integration with PlanetScale serverless driver

// Next.js API route / middleware targeting the Edge runtime
export const runtime = 'edge';

import { connect } from '@planetscale/database';

const conn = connect({
  host: process.env.DATABASE_HOST,
  username: process.env.DATABASE_USERNAME,
  password: process.env.DATABASE_PASSWORD,
});

export async function GET() {
  const results = await conn.execute('SELECT * FROM users LIMIT 10');
  return Response.json(results.rows);
}

The driver's use of fetch() as its only networking primitive is what makes it compatible.

Seen in

Last updated · 378 distilled / 1,213 read