Repository navigation
Using Prisma 8 with both PostgreSQL and MongoDB in one Next.js 16 application — supported architecture and migration from Prisma 6 #30683
Replies: 3 comments 3 replies
|
Here is the recommended architecture and guidance for your three questions: 1. Production Readiness of Prisma 8 Dual-Provider SetupRunning 2. Multi-Provider Architecture in Next.jsIf you are moving forward with this setup, your multi-package monorepo approach (e.g. via Turborepo or npm workspaces) is indeed the officially supported pattern:
3. Recommended Prisma Version
This remains the most battle-tested production pattern until Prisma 8 reaches General Availability across both target providers. |
|
One thing I'd try before removing Suspense is testing the deployed page with JavaScript disabled. Since the local reproduction mentioned above already renders the books correctly, I'm wondering if the flash is actually happening during hydration rather than during the initial server render. I'd check a few things:
The JavaScript test would be particularly useful here. If the books appear immediately with JS disabled but the fallback flashes when JS is enabled, I'd investigate hydration or client-side rendering behavior. If the fallback is already visible with JS disabled, that points more toward what Vercel is actually serving in the initial HTML. One small detail: the fallback text might also appear inside serialized React payload scripts, so just searching the HTML for "Loading books" isn't enough to prove it was displayed. I wouldn't assume Suspense automatically causes a separate streaming step here. If the cached data is resolved during prerendering, React can output a completed Suspense boundary directly. Honestly, since this only seems to happen on Vercel, I'd be curious to see the deployed HTML and whether disabling JS changes anything. That might help narrow it down without removing Suspense just to hide the issue. |
|
I reproduced this with the current RCs (
This is the layout I verified end to end: npm workspaces, Next.js 16.4.0 (Turbopack), and Each DB package has a On your specific questions:
Staying on Prisma 6? Prisma 7 has no MongoDB connector, so for Mongo the path forward is Prisma 8, where MongoDB is still Early Access. Prisma 6 only gets security patches, and only until 19 Nov 2026. Its last release is 6.19.3. If you need production stability today, bump both generated clients from 6.4.1 to 6.19.3 and pin Docs: Multiple databases (same idea with two Postgres DBs, one config each via |
Uh oh!
There was an error while loading. Please reload this page.
Hello Prisma team,
I would appreciate guidance on using both PostgreSQL and MongoDB in the same Next.js 16 application, running in the Node.js runtime.
Our existing implementation uses:
{ "prisma": "6.4.1", "@prisma/client": "6.4.1" }Before migrating, we tested Prisma 8 in a separate proof of concept.
Versions tested
16.4.08.0.0-rc.21@prisma/orm-postgres:8.0.0-rc.17@prisma/orm-mongo:8.0.0-rc.17pg):8.22.07.7.0What we have verified
Installing both database libraries in the same project manifest caused contract emission to fail with
CLI.PROJECT_MANIFEST_INVALID.As a workaround, we separated the setup into:
With this arrangement, installation and dependency checks passed. Both contracts were emitted successfully, a shared consumer passed strict TypeScript checking, and both runtime modules could be imported in one Node.js process without creating database clients or connections.
However, we have not verified live database operations, migrations, transactions, or successful Next.js production/dev execution.
Our Next.js build attempt was stopped by our own restrictive network guard when Turbopack’s CSS processor attempted internal loopback IPC. We do not consider that evidence of a Prisma compatibility problem.
Our three main questions
1. Can we use Prisma 8 for both PostgreSQL and MongoDB in a single Next.js 16 application?
Is this combination supported and recommended today, particularly for production, given PostgreSQL’s release-candidate status and MongoDB’s early-access status?
2. How should we implement it?
Could you provide an official example or recommended project structure covering:
serverExternalPackagesconfiguration.Is the manifest restriction we encountered intentional? Is our separate-package workaround supported, or should we use a different architecture?
3. Do we need to continue using
"@prisma/client": "6.4.1"for this dual-database application?If Prisma 8 is not yet recommended for this use case, should we remain on Prisma 6? If so, which maintained Prisma 6 version should we use rather than retaining the old
6.4.1release?If Prisma 8 is suitable, what is the recommended migration path for an application that currently uses two generated Prisma 6 clients?
We understand that successful offline checks do not establish production readiness, and we are not expecting atomic transactions across the two databases.
Official guidance or a minimal working Next.js 16 example would be very helpful. Thank you!
All reactions