Skip to main content
InterviewHubPRO
Section Overview
Q34

Question 34 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

68%
Next.js & App Router (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Optimizing Edge Runtime vs. Node.js Runtime (`export const runtime = 'edge' | 'nodejs'`).

senior LevelSystem Design

In Simple Words:

  • Node.js Runtime (Default):
    • Full access to Node.js APIs (fs, net, crypto, native C++ binaries like Sharp).
    • Can connect to standard database pools. Cold starts: 200-800ms.
  • Edge Runtime (V8 Isolates):
    • Runs on lightweight Web Workers / V8 isolates across 300+ global edge locations.
    • Sub-10ms cold starts.
    • Limitations: No fs, no eval, 4MB memory limit, and cannot use native Node TCP drivers (must use HTTP or WebSocket database drivers like Neon or Prisma Accelerate).