Why I Reached for Drizzle Instead of Prisma
No code generation step, no query engine binary, and queries that read like the SQL they run. What Drizzle gets right in 2024, and where Prisma still wins.
Prisma was the first ORM that made databases feel friendly to me. A schema file, a generated client, autocomplete for every query. For a long time I didn't look at anything else.
Then I started deploying to serverless and edge runtimes, and Prisma's architecture started showing. This year I've been reaching for Drizzle instead. Here's why, and where I'd still pick Prisma.
The difference is how many layers sit between you and the database
When you call Prisma today, your query goes from the generated JavaScript client to a separate query engine written in Rust, which builds the SQL and talks to the database. That engine is a binary that ships with your app.
On a long-running server, you barely notice. On serverless, you notice:
- Bundle size. The engine adds megabytes to every function.
- Cold starts. The engine has to load before the first query runs.
- Edge runtimes. Running it on Cloudflare Workers or Vercel Edge needs extra setup, like Prisma Accelerate or driver adapters.
Drizzle has none of that. It's a TypeScript library that builds a SQL string and hands it to whatever driver you already use: postgres, pg, Neon's serverless driver, libSQL, D1. One layer. That's where "Drizzle is fast" comes from. It isn't magic. It's just less work between your code and the database.
Your schema is TypeScript
import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
export const orders = pgTable("orders", {
id: text("id").primaryKey(),
partnerId: text("partner_id").notNull(),
total: integer("total").notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
});No separate schema language and no generate step after every change. Types come straight from this file, so editing a column updates your types the moment you save.
Queries read like SQL, because they are SQL
const recent = await db
.select({ id: orders.id, total: orders.total })
.from(orders)
.where(and(eq(orders.partnerId, partnerId), gt(orders.total, 100_000)))
.orderBy(desc(orders.createdAt))
.limit(20);If you know SQL, you already know this API. More importantly, you know exactly what query runs. When something is slow, you look at the code and see the SQL, instead of logging what an engine generated for you.
For nested data, there's a relational query API that feels closer to Prisma:
const partner = await db.query.partners.findFirst({
where: eq(partners.id, partnerId),
with: { orders: { limit: 5 } },
});It still compiles to a single SQL statement, not one query per relation.
Migrations
Drizzle Kit compares your TypeScript schema to the database and writes SQL migration files:
npx drizzle-kit generate
npx drizzle-kit migrateThe output is plain SQL you can read and edit in review. I like that more than I expected.
Where Prisma still wins
I don't want to pretend this is one-sided:
- Onboarding. Prisma's schema file and docs are easier for someone who doesn't know SQL well. Drizzle assumes you do.
- Maturity. Drizzle is still on 0.x. Expect API changes between versions.
- Tooling around the edges. Prisma's migration workflow and ecosystem have had years longer to smooth out rough corners.
The serverless pain is also Prisma's most common complaint, and its team clearly knows it. If they remove the engine binary, this comparison changes.
What I'd pick today
For a new project deploying to serverless or edge, with a team that's comfortable in SQL: Drizzle. For a team that wants the gentlest path from zero to a working database, or a long-running server where the engine's cost doesn't matter: Prisma is still a good choice.
Either way, the question to ask isn't which is faster in a benchmark. It's how many layers you want between your code and your data, and whether you want to see the SQL you're running.