Databases & ORMs
Where to put data, and how to talk to it from TypeScript.
Database engines
- ★ Postgres — boring, durable, scales further than 99% of products will ever need. Use it.
- SQLite — incredible at the edge (D1, Turso), or embedded server-side via better-sqlite3 / libsql. Plus LiteFS / Litestream for replication.
- MySQL / PlanetScale (Vitess) — MySQL is still huge; PlanetScale (now Vitess-based managed) is great for horizontal scale.
- MongoDB — fine if you have actual document use cases; usually you don't.
- DuckDB — analytical SQL on a single file; can run in-browser (DuckDB-Wasm). Killer for analytics features.
- Redis / DragonflyDB / KeyDB / Upstash Redis — caches and pub/sub.
- ClickHouse — analytics database; powerful, growing in app-tier use.
Postgres-flavored hosts
- ★ Neon — serverless Postgres, branching, generous free tier.
- ★ Supabase — Postgres + auth + storage + realtime + edge functions, open source.
- Railway, Render, Fly Postgres, Crunchy Bridge, AWS RDS / Aurora, GCP Cloud SQL.
- Cloudflare Hyperdrive — connection pool / caching layer in front of any Postgres for Workers.
SQLite-flavored hosts
- Cloudflare D1 — SQLite at the edge.
- Turso — libSQL fork of SQLite; multi-region replicas, edge reads.
TypeScript ORMs / query builders
- ★ Drizzle ORM — close to SQL, tiny runtime, edge-compatible, type-safe schema and queries. The most-recommended ORM for new TS projects in 2026.
- ★ Prisma — schema-first, mature, great migrations and Studio UI. Recent versions improved edge support meaningfully via the Postgres adapter.
- Kysely — pure query builder; closest to SQL of all, no ORM-isms. Great if you want SQL, just typed.
- TypeORM — older, decorator-style; mature, more enterprise.
- MikroORM — DataMapper pattern, less popular but solid.
"Beyond ORM" data layers
- Convex — TypeScript queries against a typed document DB; live by default.
- EdgeDB / Gel — typed object DB on top of Postgres; clean schema language.
- PowerSync, Replicache, Zero (by Rocicorp) — sync engines for offline-first apps.
- Electric SQL — Postgres ↔ SQLite local-first sync.
- Triplit, InstantDB — full-stack realtime DBs designed for collaborative apps.
Migrations
- Drizzle Kit, Prisma Migrate, Atlas (works with any DB, schema-first), graphile-migrate.
Pick this if…
- Default new project: Postgres + Drizzle ORM.
- You want a UI for the DB and migrations to "just work": Prisma.
- You want raw SQL with types: Kysely.
- Edge-first, want it to just work on Workers: Drizzle + Neon (over Hyperdrive) or Turso.
- Realtime / live queries: Convex, Triplit, or Supabase Realtime.
- Local-first / offline-first: Replicache, Zero, ElectricSQL.