mcpField
E
edge-computing

edge-computing

github.com/travisjneumanCloud & DevOps10695 installsUpdated today
Repository

About edge-computing

A reference skill for deploying applications at the edge, aimed at developers comparing runtimes, data stores, and implementation patterns. It covers platform constraints alongside common edge architecture techniques.

Key features

  1. 01Runtime and platform comparisons
  2. 02Edge database options
  3. 03Rendering, routing, and caching patterns
  4. 04Rate limiting and A/B testing
  5. 05Runtime constraints and database guidance

Use cases

  1. 01Choosing an edge runtime for an application
  2. 02Selecting a database for edge workloads
  3. 03Designing geographic routing and caching
  4. 04Checking runtime limits before deployment

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/travisjneuman/.claude --skill edge-computing

After installing, type/edge-computingin Claude Code to confirm it loaded.

Details

From the project README

Edge Computing

Platforms

PlatformRuntimeCold StartLimits
Cloudflare WorkersV8 isolates~0ms128MB, 30s CPU
Deno DeployV8 isolates~0ms512MB, 50ms CPU
Vercel Edge FunctionsV8 isolates~0ms128MB, 25s
AWS Lambda@EdgeNode.js~100ms128MB, 5s (viewer)
BunJavaScriptCoreN/A (server)No hard limits

Cloudflare Workers

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const url = new URL(request.url);

    // KV storage
    const cached = await env.KV.get(url.pathname);
    if (cached) return new Response(cached, { headers: { 'Cache-Control': 'max-age=60' } });

    // D1 database
    const { results } = await env.DB.prepare('SELECT * FROM users WHERE id = ?')
      .bind(url.searchParams.get('id'))
      .all();

    // Durable Objects for state
    const id = env.COUNTER.idFromName('global');
    const obj = env.COUNTER.get(id);
    const count = await obj.fetch(request);

    return new Response(JSON.stringify(results));
  }
};

Edge Databases

DatabaseTypeBest For
Cloudflare D1SQLiteWorkers-native, SQL at edge
TursolibSQL (SQLite)Multi-region replicas, embedded
Cloudflare KVKey-valueSimple caching, config
Durable ObjectsStatefulReal-time, coordination, counters
Upstash RedisRedisRate limiting, sessions at edge

Deno Deploy

Deno.serve(async (req: Request) => {
  const kv = await Deno.openKv();
  const url = new URL(req.url);

  if (req.method === "POST") {
    const body = await req.json();
    await kv.set(["items", crypto.randomUUID()], body);
    return new Response("Created", { status: 201 });
  }

  const entries = kv.list({ prefix: ["items"] });
  const items = [];
  for await (const entry of entries) items.push(entry.value);
  return Response.json(items);
});

Patterns

  • Edge-side rendering: SSR at the edge for <50ms TTFB globally
  • Smart routing: Geo-aware request routing based on request.cf.country
  • Edge caching: Cache API for fine-grained control, stale-while-revalidate
  • Rate limiting: Sliding window counters with Durable Objects or Upstash
  • A/B testing: Edge-side feature flags without origin round-trips
  • Image optimization: On-the-fly transforms at edge (Cloudflare Images, Imgproxy)

Constraints & Gotchas

  • No Node.js APIs (fs, net, etc.) in V8 isolate runtimes
  • No native modules or binaries (use WASM for compute-heavy work)
  • Limited CPU time per request — offload heavy work to queues
  • Cold starts are near-zero for isolates but real for Lambda@Edge
  • Database connections: use HTTP-based clients, not TCP connection pools

Comments

Markdown supported