advanced

Deployment on Vercel or custom Node runtime

Choose hosting, runtime, build output, environment variables, observability, and operational ownership deliberately.

Deployment choices affect runtime (Node versus Edge), static asset hosting, environment variables, observability, and who owns scaling. Vercel optimizes Next.js defaults; custom Node or Docker hosting trades convenience for control.

Key operational concerns: separate preview and production env vars, health checks, log aggregation, zero-downtime deploys, and cache purge strategy after releases.

					# Custom Node start after next build
NODE_ENV=production node server.js
				

On interviews: compare managed platform features with self-hosted responsibilities — image optimization, ISR, and edge middleware may need extra setup off-platform.

Common pitfalls: leaking server secrets to client env prefixes, no rollback plan, and deploys without revalidation or CDN purge.

The trade-off is platform velocity versus infrastructure ownership and compliance needs.

Checklist:

  • Scope env vars to server versus client.
  • Automate preview deployments per branch.
  • Monitor cold starts and error rates.
  • Document cache behavior on deploy.