Back to DocsRecipe

Edge Compute Primer

Run your logic at the network edge — close to users, far from latency.

What is edge compute?

Edge compute moves execution from a single origin server to a globally distributed network of points-of-presence. When a request arrives, the nearest edge node handles it — no cross-continent round trips. Vercel Edge Functions and Cloudflare Workers are the two dominant runtimes in this space.

Why it matters for Nimbus

License validation, feature flags, and telemetry ingestion all benefit from sub-50ms cold starts. An edge-deployed validator can check a key before the loader finishes unpacking, blocking illegitimate sessions before they touch your kernel components.

Constraints to know

  • No raw TCP sockets — only fetch and WebSocket pair.
  • Limited execution time (typically 10–30s depending on plan).
  • V8 isolates, not Node.js — no child_process, no fs.
  • Memory ceiling around 128 MB per invocation.

Quick start pattern

export const config = { runtime: "edge" };

export default async function handler(req: Request) {
  const key = req.headers.get("x-nimbus-key");
  if (!key) return new Response("unauthorized", { status: 401 });

  const valid = await verifyKey(key);
  return Response.json({ valid });
}

Deploy this alongside your dashboard and the loader calls it during initialization. Combine with Upstash Redis for rate-limiting and you have a global license gate in under 100 lines.

Next step

Read License Gate Recipe for a complete edge-deployed validator with HMAC-signed offline grace caches.