ORM Introduced in L3

Prisma

The TypeScript-first ORM. Schema-driven, type-safe, the default for most modern Node apps.

Mindmap

hover · click to navigate
this tech depends on / used by alternative Shipyard anchor
What it is

The plain-English version

Prisma is a TypeScript ORM (Object-Relational Mapper) — it lets you describe your database schema in a single file, then gives you a fully type-safe client to query it. The schema becomes the source of truth: migrations, types, and the client are all generated from it.

Why it exists

The problem it solves

Pre-Prisma, Node ORMs were painful: TypeORM, Sequelize, Knex — all required juggling separate model files, migration files, and types. Prisma collapses them into one workflow. The generated TypeScript types catch query mistakes at compile time. The migration tooling is the calmest in the Node ecosystem.

What it competes with

Alternatives

AlternativeTypeWhen it wins
PostgresdatabaseThe serious open-source relational database. The default choice for most production apps that need structured data.
MongoDBdatabaseThe dominant document database. Schemaless flexibility, JSON-shaped documents, harder consistency tradeoffs.
Redisin-memory storeThe in-memory key-value store. Fast cache, fast queue, fast everything that doesn't need durability.
Where it shows up in Shipyard

Deep links

Vocabulary

The words you'll hear

schema.prisma
The schema file. Describes models, relations, datasource.
Prisma Client
Generated typed client. prisma.task.findMany(...).
Migration
Versioned SQL files in prisma/migrations/. prisma migrate dev/deploy.
Prisma Studio
Built-in GUI for browsing the database in development.
Pulse, Accelerate
Prisma's hosted services for real-time and connection pooling.
Prompting

Bad vs. good prompt for Prisma

✕ Bad prompt
set up prisma
✓ Good prompt
Set up Prisma in this Next.js + Postgres project. Define User, Project, Task, Comment models in schema.prisma with relations and unique constraints. Run migrate dev to create the initial migration. Add the singleton client pattern in lib/prisma.ts (avoid hot-reload issues in Next dev mode).

Why it works: Specifies the target stack, model shape requested, the migration command, and asks for the canonical Next.js singleton pattern that prevents the connection-leak warning new users always hit.

Pitfalls

What bites real teams

⚠ Generating client mid-deploy

Forgetting prisma generate in the build step → production runs old generated types. Most starters have it; verify.

⚠ Connection leaks in Next dev

Without the singleton pattern, hot-reloading creates new clients each save until you OOM.

⚠ N+1 with relations

findMany({ include: { tasks: true } }) avoids N+1; multiple separate queries don't. Read the relation docs once.

References

Official docs only