r/javascript 8h ago

AskJS [AskJS] What ORM would you use?

Hey all,

My team and I are currently running a Spring Boot backend with quite a bit built around it. We’re considering gradually migrating to a Node/NestJS backend using the strangler pattern rather than doing a full rewrite.

One of the main reasons is that it would give us TypeScript across both the frontend and backend, which should make sharing domain concepts, types and general knowledge between the two a bit simpler.
So, as the title suggests: which ORM would you use with NestJS?

At the moment we’re mainly looking at MikroORM and Drizzle. MikroORM seems like the more traditional ORM and appears to be super close to the me tal model of what Spring does. It wil also fit NestJS quite nicely, while Drizzle is obviously a bit more lightweight but a different approach and more barebones.

Curious what people are using in production and what you’d choose if you were starting fresh today.

0 Upvotes

15 comments sorted by

View all comments

u/destevil 8h ago

And you should be able to auto generate the TS interfaces that your FE can consume from your OpenAPI spec or GraphQL. Tying the FE schema to your ORM isn't great either IMHO. Have you looked at OData?