Why Drizzle on MVPs
Stay close to SQL. TypeScript inference is good enough. Migrations are reviewable. Teams can hire for Postgres, not ORM dialect.
Folder layout
db/
schema/
users.ts
orders.ts
index.ts # barrel export
migrations/
client.ts # single db instance pattern
// schema/users.ts
export const users = pgTable("users", {
id: uuid("id").defaultRandom().primaryKey(),
email: text("email").notNull().unique(),
createdAt: timestamp("created_at", { withTimezone: true })
.defaultNow()
.notNull(),
});
Request path on Vercel
Migrations in CI
drizzle-kit generatein PR — human reads SQL- Apply to staging DB in CI
- Prod apply in deploy step or manual gate
- Never edit applied migration files
Serverless connection rules
| Environment | Pattern |
|---|---|
| Vercel serverless | Neon serverless driver / pool size 1 per invocation |
| Long worker | Dedicated pool or PgBouncer |
| Local dev | Direct connection OK |
Pitfalls we hit
- N+1 in RSC — batch with
inArrayor joins - Missing FK indexes — filter columns need indexes
timestampwithout TZ — usetimestamptz- Transactions in Server Actions — know your isolation level
TL;DR
Drizzle rewards migration discipline early. Cheap at week 2, priceless at month 6.
From the notebook
Building something? Let's ship it.
MVPs, AI-assisted dev, web & mobile — founder-led team in Delhi. Tell us what you're making.
Keep reading
All articlesExplore Quezt Labs