Journal

Edge BFF: when it pays off (and when it doesn't)

A straight take on Next.js edge routes and regional compute: latency wins, sharp edges with Node-only libs, and how we decide per project.

"Move everything to the edge" sells conferences. In client work we pick edge when it measurably affects UX, not by default.

When edge shines

  • Read-heavy BFF shaping responses for the browser: auth checks, fan-out to fast upstreams, HTML tweaks, especially when users are globally distributed.
  • JWT/session gates close to the user with minimal cold-start surprises on stable routes.

When we stay on Node (or containers)

  • Heavy nodemailer, PDF generation, long CPU work, or libraries that assume full Node APIs.
  • Workloads needing large payloads, streaming quirks, or vendor SDKs that aren't edge-safe yet.

Rule of thumb

Prototype on Node until profiling proves edge removes real latency from your p95. Swap critical paths. Don't cargo-cult the runtime.