Question presented to candidate: "We are choosing between Vercel and running Next.js on our own Kubernetes cluster. What do we get on each, and what must we set up ourselves when self-hosting?"
What a strong answer should cover:
- Deployment options: a managed platform (Vercel or another provider with Next.js support), a Node.js server (
next start), a Docker image (usually withoutput: "standalone"), or a static export (output: "export"). - Every server feature works self-hosted with
next start: SSR, streaming, ISR, Server Actions, Route Handlers, Proxy and image optimization. - Self-hosting responsibilities: caching across instances (a shared
cacheHandler), a CDN for static assets, TLS, scaling, logs and metrics. - Static export produces plain files but drops server features: no Server Actions, dynamic routes without params, request-time rendering, ISR, redirects or rewrites.
- Version skew between deployments (old clients calling new servers) needs
deploymentIdor careful rollouts.
Clarifying questions expected:
- "Do we need ISR, Server Actions or request-time rendering?" β they rule out static export.
- "How many instances will run?" β more than one needs a shared cache.
Code / implementation expected: Yes β a Dockerfile for standalone output.