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.
Por Que É Importante
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.
Considerações Importantes
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.
Nossas Recomendações
Prisma
Melhor ORM Excelente Suporte SDK OficialPrisma 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
Melhor Tudo em Um Excelente Suporte SDK OficialSupabase 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
Melhor para Edge Excelente Suporte SDK OficialTurso 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
Melhor PostgreSQL Serverless Excelente Suporte SDK OficialNeon 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
Melhor para Escalar Bom Suporte SDK OficialPlanetScale 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 Comparação Rápida
| Serviço | TypeScript | Edge | Plano Gratuito | Tempo de Configuração |
|---|---|---|---|---|
| | 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 |
Início Rápido
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>
);
} Padrões de Integração Comuns
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.