Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Announcement mediumAdept

Improving the developer experience for Prisma users

Neon shipped three changes to smooth Prisma integration: faster cold starts from scale-to-zero, simultaneous pooled (PgBouncer) and direct connection strings, and SQL-based role/database management that removes the need for a manual shadow database. Prisma 5 users in the same region as their database likely no longer need a raised connect_timeout to avoid P1001 errors. Prisma Migrate fails over PgBouncer with a "prepared statement already exists" error, so the pooled `-pooler` endpoint goes in `url` and the direct endpoint in `directUrl` in schema.prisma. The `shadowDatabaseUrl` workaround can now be dropped.

Assumes: Prisma ORM basicsPostgreSQL connection strings

Related posts

  • Better Postgres with Prisma Experience

    Neon mediumAdept

    Prisma users on Neon can now use a single pooled Postgres connection string for both serverless queries and schema migrations, replacing separate pooled, direct and shadow database URLs. PgBouncer 1.22.0 added support for prepared statements and DISCARD ALL/DEALLOCATE ALL, which fixes the "prepared statement already exists" errors `prisma migrate` used to hit through the pooler, and the `pgbouncer=true` parameter is no longer needed. Neon also enabled role and database management via SQL, and Prisma 5.10.0 added DROP DATABASE WITH (FORCE), so `prisma migrate dev` can create and drop its own shadow database without manual setup.

  • Postgres 17 is Now Available on Neon

    Neon mediumAdept

    Postgres 17 is available on Neon for all plans, including Free, and can be provisioned in a few steps. The post walks through new PG17 features with runnable SQL: MERGE with RETURNING and merge_action(), random(min, max) for generating test data, JSON_TABLE for turning JSON into relational rows, the sslnegotiation=direct connection parameter, and EXPLAIN reporting planner memory usage. Neon's proxy supports direct SSL negotiation even for older server versions, which cut a sample psql connection from 0.87s to 0.75s. Major version upgrades on Neon still require manual steps and a check of extension compatibility.

  • Using Neon’s Scale to Zero with Long-Running Applications

    Neon mediumAdept

    Neon's scale to zero suspends a Postgres compute after an idle window (only when no WAL senders are active and autovacuum isn't running), which severs connections held by long-running servers. A naive node-postgres Client crashes on the resulting unhandled error event. A client-side pg.Pool with an error handler tolerates the dropped connections and reconnects on demand, waking the database. In Apache Bench tests the pool beat per-request connections by more than 10x (about 46ms vs 678ms average latency, 370 vs 26 req/s), with the same pattern shown in a Fastify, Drizzle and HTMX example app.

  • How Shipsidekick replaced Neon with ClickHouse Managed Postgres for 10x faster queries and better reliability

    ClickHouse mediumAdept

    Shipsidekick, a logistics platform built on Next.js and Vercel, moved its Postgres database from Neon to ClickHouse Managed Postgres after repeated outages. The failures came from connection pool exhaustion across Prisma, Vercel Fluid compute and Neon's PgBouncer, at around 3,000 connections. ClickPipes logical replication moved 500 GB in 4-5 hours. One snag was a partial unique index tripped by mid-flight transactions, fixed by dropping the index and re-creating it after replication. With the bundled PgBouncer, NVMe storage and a single async standby, CPU fell from 100% to 5-10%, cache hit rate rose from 30-35% to 99%, and queries ran about 10x faster. AI agents querying the primary caused CPU spikes, which the team handled with statement timeouts and later a dedicated read replica.

  • A database for every preview environment using Neon, GitHub Actions, and Vercel

    Neon mediumAdept

    Neon's copy-on-write branching can give every pull request its own production-like Postgres database, avoiding the bottlenecks of shared staging or shared preview databases. Branches are isolated, are created in about a second regardless of database size, and bill only for unique data. A GitHub Actions pipeline creates a Neon branch per PR, runs Prisma migrations against it, deploys a Vercel preview wired to that branch, and comments the URLs on the PR. Merging applies migrations to the primary branch, deploys to production and deletes the preview branch.

The quest for software engineering knowledge.

Look:
Layout: