Best Database for Remix (2026)
Compare the best database solutions for Remix. We review Prisma, Drizzle, Supabase, Turso, and more with loader optimization and type-safe queries.
Remix's loader/action pattern makes database access straightforward—every loader runs on the server, so you can query your database directly. The question is which database and ORM to use. Your choice affects type safety, performance, and deployment options.
Why This Matters
Remix encourages colocating data loading with UI. This means you'll be writing a lot of database queries in loaders. A good ORM with type safety prevents runtime errors. The right database choice depends on your deployment target—serverless, edge, or traditional server.
Key Considerations
ORM vs Query Builder
Prisma (ORM) vs Drizzle (query builder) is the main decision. Prisma has better DX and migrations. Drizzle is lighter and faster. Both are excellent with Remix.
Edge Deployment
If you're deploying to Cloudflare Workers or Vercel Edge, you need a database with HTTP/WebSocket drivers. Traditional PostgreSQL connections don't work at the edge.
Connection Pooling
Serverless deployments create many short-lived connections. Databases like Neon, PlanetScale, and Turso handle this well. Traditional PostgreSQL needs a pooler like PgBouncer.
SQLite vs PostgreSQL
SQLite (via Turso) offers edge-fast reads with global replication. PostgreSQL is more powerful for complex queries. Remix works great with both.
Type Safety
Both Prisma and Drizzle provide full TypeScript inference. Your loader return types should match what you query. Pick an ORM that generates types from your schema.
Our Recommendations
Prisma
Best ORM Excellent Support Official SDKPrisma is the most popular ORM in the Remix ecosystem. Excellent TypeScript support, schema-as-code, great migrations. Works with PostgreSQL, MySQL, SQLite, MongoDB. Prisma Accelerate adds edge caching and connection pooling.
npx prisma init Supabase
Best All-in-One Excellent Support Official SDKSupabase provides PostgreSQL + auth + storage in one. Great for Remix apps that need the full stack. Generated TypeScript types, realtime subscriptions, and a generous free tier (500MB, unlimited rows).
npm install @supabase/supabase-js Turso
Best for Edge Excellent Support Official SDKTurso is SQLite at the edge with global replication. Sub-millisecond reads from edge locations. Perfect for Remix on Cloudflare Workers. 9GB free, works great with Drizzle ORM.
npm install @libsql/client Neon
Best Serverless PostgreSQL Excellent Support Official SDKNeon is serverless PostgreSQL with instant branching and scale-to-zero. Great for Remix on Vercel or any serverless platform. Edge-compatible driver, generous free tier (0.5GB with branching).
npm install @neondatabase/serverless PlanetScale
Best for Scale Good Support Official SDKPlanetScale is serverless MySQL with unlimited horizontal scale and database branching. Great for larger teams. Note: free tier was removed in 2024, so it's best for production workloads with budget.
npm install @planetscale/database Quick Comparison
| Service | TypeScript | Edge | Free Tier | Setup Time |
|---|---|---|---|---|
| | full | ✓ | N/A (ORM) | 15 min |
| | full | ✓ | 500MB, 2 projects | 10 min |
| | full | ✓ | 9GB, 500 DBs | 5 min |
| | full | ✓ | 0.5GB, branching | 5 min |
| | full | ✓ | None (paid) | 10 min |
Quick Start
import { json, LoaderFunctionArgs } from '@remix-run/node';
import { useLoaderData } from '@remix-run/react';
import { prisma } from '~/lib/prisma.server';
export async function loader({ params }: LoaderFunctionArgs) {
const post = await prisma.post.findUnique({
where: { slug: params.slug },
include: { author: true },
});
if (!post) throw new Response('Not Found', { status: 404 });
return json({ post });
}
export default function Post() {
const { post } = useLoaderData<typeof loader>();
return (
<article>
<h1>{post.title}</h1>
<p>By {post.author.name}</p>
<div>{post.content}</div>
</article>
);
} Common Integration Patterns
Prisma + Neon + Vercel
Type-safe queries with Prisma, serverless PostgreSQL with Neon, deployed to Vercel. Works perfectly with Remix's loader pattern.
Drizzle + Turso + Cloudflare
Lightweight ORM with Drizzle, edge SQLite with Turso, deployed to Cloudflare Workers. Fastest possible data access at the edge.
Supabase Full Stack
Supabase for database, auth, and storage. Generated types, row-level security, realtime subscriptions. Simplest full-stack Remix setup.