Skip to content

FlashcardNot attempted

Edge vs Node runtime

Recall it before you reveal

When would you choose the Edge runtime over Node.js for a route?

Space to reveal
Show answer & explanation

Edge: lightweight, low-latency compute near the user, for redirects, rewrites, auth and geo checks. Limited APIs: no Node built-ins and many DB drivers don't work. (Cacheable pages are served from the CDN whatever the runtime. Next 16 replaces middleware with proxy.ts on Node, and Node is the default for most routes.)

Node.js: full ecosystem. Use it for business logic, direct database access, auth-protected APIs, mutations and background work.

And remember Node's event loop: CPU-heavy work in a Server Component blocks every user on that instance.