Aller au contenu principal
Remix Remix Guide

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.

Pourquoi C'est Important

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.

Considérations Clés

01

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.

02

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.

03

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.

04

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.

05

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.

Nos Recommandations

Prisma
#1

Prisma

Meilleur ORM Excellent Support SDK Officiel

Prisma 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
#2

Supabase

Meilleur Tout-en-Un Excellent Support SDK Officiel

Supabase 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
#3

Turso

Meilleur pour Edge Excellent Support SDK Officiel

Turso 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
#4

Neon

Meilleur PostgreSQL Serverless Excellent Support SDK Officiel

Neon 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
#5

PlanetScale

Meilleur pour Évoluer Bon Support SDK Officiel

PlanetScale 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

Comparaison Rapide

Service TypeScript Edge Offre Gratuite Temps de Configuration
Prisma
full N/A (ORM) 15 min
Supabase
full 500MB, 2 projects 10 min
Turso
full 9GB, 500 DBs 5 min
Neon
full 0.5GB, branching 5 min
PlanetScale
full None (paid) 10 min

Démarrage Rapide

Query Database in Remix Loader with Prisma app/routes/posts.$slug.tsx
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>
  );
}

Modèles d'Intégration Courants

Prisma + Neon + Vercel

Type-safe queries with Prisma, serverless PostgreSQL with Neon, deployed to Vercel. Works perfectly with Remix's loader pattern.

prisma neon vercel

Drizzle + Turso + Cloudflare

Lightweight ORM with Drizzle, edge SQLite with Turso, deployed to Cloudflare Workers. Fastest possible data access at the edge.

drizzle-orm turso cloudflare-workers

Supabase Full Stack

Supabase for database, auth, and storage. Generated types, row-level security, realtime subscriptions. Simplest full-stack Remix setup.

supabase supabase-auth supabase-storage

Questions Fréquemment Posées

Should I use Prisma or Drizzle with Remix?
Prisma for better DX, migrations, and community. Drizzle for smaller bundle, faster queries, and more SQL control. Both integrate well with Remix loaders. Prisma is the safer choice for most projects.
What's the best database for Remix on Cloudflare Workers?
Turso (SQLite at edge) or Neon (PostgreSQL) with their edge-compatible drivers. Traditional PostgreSQL won't work because Workers can't open TCP connections. D1 is also an option if you want to stay in Cloudflare's ecosystem.
Can I use SQLite with Remix in production?
Yes, Turso makes SQLite production-ready with global replication, backups, and scale. It's excellent for read-heavy Remix apps. For write-heavy workloads, PostgreSQL is still recommended.
What database has the best free tier for Remix?
Turso (9GB, 500 databases) is the most generous. Supabase (500MB, unlimited auth) is great if you need more than just a database. Neon (0.5GB with branching) is good for PostgreSQL purists.

Guides Connexes

Dernière mise à jour: January 11, 2026