Neon. Vercel runs your Next.js routes, Server Components, and Route Handlers; Neon provides the backend those routes talk to: Postgres, Managed Better Auth, Object Storage, and Neon Functions for the pieces that outgrow a serverless request. The Vercel-Managed Integration installs from the Vercel Marketplace, routes billing through your Vercel invoice, and creates a database branch for every Preview Deployment.

Database: install once, branch per PR

Install the Neon integration, pick an AWS region, and Vercel injects DATABASE_URL (pooled) and DATABASE_URL_UNPOOLED into your project. Enable Preview Branching and each Preview Deployment gets a copy-on-write branch of production data with its own connection string, so migrations in a PR never touch the production branch (Vercel-Managed Integration).

app/lib/db.ts
import { neon } from '@neondatabase/serverless';

export const sql = neon(process.env.DATABASE_URL!);

Route Handlers open a new connection per invocation, so use the pooled string: Neon's PgBouncer endpoint accepts up to 10,000 client connections per compute (connection pooling). The serverless driver queries over HTTP, which also works in edge routes (serverless driver).

Auth that follows the branch

Managed Better Auth has a Next.js server SDK: two files give you auth.handler() on an API route and session access in Server Components (Next.js quick start). Users and sessions live in the neon_auth schema, so when a Preview Deployment gets its own branch it gets its own auth state too, and you can test sign-up flows with real data in a preview (branching authentication).

When a route handler isn't enough

Vercel Functions run for 300 seconds by default and up to 800 seconds on Pro and Enterprise, with a 30-minute extended maximum in beta (Vercel duration). For a WebSocket server, an SSE feed, or an agent that streams for longer, move that one slice onto a Neon Function next to the database and call it directly from the client. Functions give a handler 15 minutes to begin responding and keep streams open while data flows (how Functions fit with your app). Functions, Object Storage, and AI Gateway are in beta and available in aws-us-east-2 and aws-eu-central-1, with support expanding toward all regions.

Run migrations in the build step

Add prisma migrate deploy or drizzle-kit migrate to the Vercel build command so each Preview Deployment applies its PR's schema to its own branch.

What it costs

The Free plan covers prototypes: 0.5 GB of storage per project, 100 CU-hours of compute per project per month, 10 branches per project, and Auth up to 60k MAU. Launch is usage-based at $0.106/CU-hour and $0.35/GB-month with no monthly minimum; compute scales to zero after 5 minutes idle while storage continues to bill (plans).

How other options compare

  • Supabase: Auth, Storage, and Realtime are GA (features). Preview branches are the gap for a Vercel workflow: each one is a separate instance rebuilt from migrations and seed files, with no production data, auth users, or storage objects by default, billed at $0.01344 per hour on Micro with compute credits not applying (branching, branching usage). A preview left open for a week costs about $2.26 and shows seed data rather than production shapes, so migration bugs that depend on real data reach production (Launch vs Pro comparison). Launch-day traffic hits the connection cap before CPU: a Micro allows 60 direct connections and 200 pooled clients, and adding headroom means a manual resize with usually under two minutes of downtime (compute and disk). Point-in-time recovery is a $100 per month per 7 days add-on (backups).
  • Vercel's former Postgres product is no longer offered; databases now come through Marketplace integrations, and the transition guide covers moving existing Vercel Postgres stores to Neon.

Vendor details verified on 2026-09-02 against the linked pages.

Add Neon to your Vercel project

Install the integration from the Vercel Marketplace and enable Preview Branching.