PostgreSQL schemas and relations
DEVNU / TECHNOLOGY / PRISMA
Prisma gives type-safe data access. It does not design the database for us.
Prisma narrows the gap between database schema and TypeScript and provides a clear migration workflow. It works best when the team still understands SQL, transactions and query cost rather than treating the ORM as a black box.
What does Prisma own in a project?
In NestJS backends, Prisma is often DEVNU's default PostgreSQL data-access layer. Schemas are versioned, clients are generated during builds, and migrations run through an explicit deployment path before application startup.
Where the technology should solve a specific problem.
Versioned migrations
Type-safe CRUD
Application transactions
Seeds and data migrations
NestJS backends and workers
When we reach for it
For domain-driven CRUD, administration systems and codebases where type safety between models and services matters, Prisma offers productive development. Common relations, transactions and migrations also follow a consistent workflow.
When we leave it out
Complex analytics, specialist bulk operations or database-specific features may be better served by direct SQL or a complementary adapter. Forcing every query through the ORM is not the goal.
Using the tool is easy. Operating it well is the real work.
- 01Real constraints in the database schema
- 02Reviewable migrations in Git
- 03Select only required data
- 04Visible N+1 and query counts
- 05Transactions only around atomic boundaries
- 06Raw SQL when it provides a real advantage
The decisions matter more than the stack badge.
Prisma or direct SQL?
Common CRUD and queries benefit from Prisma's type safety. A complex query that becomes opaque or inefficient through the ORM can move to direct SQL.
Automatic migrations on startup?
It can be practical in single-instance deployments, but scaled rollouts need explicit ordering and locking. Migrations are part of the release plan rather than an accidental startup side effect.
Do we need repositories?
Only when domain or query complexity justifies it. A one-to-one wrapper around every Prisma method merely produces more code.
Projects where Prisma is part of the recorded stack.
SUMY Website & Operations System
SUMY's bilingual industrial website, with an API, database and a dedicated admin area for pages, products, brands and incoming enquiries.
- React
- TypeScript
- NestJS
- PostgreSQL
- Prisma
- Docker
Technology only matters inside a useful outcome.
Common questions about Prisma
01Does Prisma replace PostgreSQL?+
No. Prisma is a schema, migration and data-access layer; PostgreSQL remains the actual database responsible for constraints, transactions and persistence.
02Can Prisma be used in production?+
Yes, provided connection management, migrations, query behaviour and versions are operated like any other production dependency.
09 / NEXT STEP
Start with the problem. Choose the stack second.
If the project needs this technology, the reason should be visible in architecture, performance, user experience or maintenance cost.
Describe the project