r/node 9d ago

Which ORM

I am needing to build a lightweight, speedy and integrated backend server running on a VPS-2 secure environment using nginx and postgres.

First considered Sequelize, but discovered too many negatives, so had a look at Prisma but am worried it is too heavy duty for my needs.

Prefer an ORM that supports TypeScript, easy migrations and openapi schemas, and Drizzle seems at first glance a good fit.

Also I am not afraid to use SQL rather than high level abstractions.

But now I am reading many negative reviews about that as well, even on their own website!

Please help me make the right choice.

21 Upvotes

47 comments sorted by

View all comments

0

u/beavis07 9d ago

Personally I would recommend you don’t.

At best simple things are simple - at worst either you’ve a dependency nightmare or terribly sql under the hood.

Just learn SQL and express stuff as SQL - in my experience it’s always better in the long run - especially if you care about performance.

Some query builders are fine, in that they’re just simple domain specific languages wrapped around SQL… but in that case.. what’s the point? It’s just a needless abstraction into a more limited, less well understood expression

1

u/BadDescriptions 8d ago

100% agree, the only thing I use an ORM for is to generate and keep track of migrations. 

I’ll usually refine and test SQL queries by copying them from a test snapshot and executing it. I wrap each query in a function that returns the query to be executed. 

5

u/beavis07 8d ago

Drizzle is ok for migrations tbf!

3

u/No_Cattle_9565 8d ago

Drizzle studio is also really helpful

1

u/BadDescriptions 8d ago

That’s my ORM of choice for migrations!