practicajs / practica

Node.js solution starter boilerplate that is production-ready, packed with ✅ best practices and built with simplicity in mind
https://practica.dev/
MIT License
1.38k stars 127 forks source link

Decision: Which ORM should we use? #235

Open goldbergyoni opened 1 year ago

goldbergyoni commented 1 year ago

Like any other decision, we wish to have a discussion and always compare the various options here

Which Node.js ORM should use? What important dimension should be evaluated?

rluvaton commented 1 year ago

Let's take a step back and ask, do we even want an ORM? What about query builder?

If we do decide to go with ORM than my important dimensions IMO are:

  1. Performance
  2. Security to help protecting from SQL injections
  3. Support for multiple DBs (optional not required)
  4. Migration support
  5. Type support (Maybe)
aagamezl commented 1 year ago

I like the ORM option more than a Query Builder and my vote goes to Prisma.

koyuncuoglum95 commented 1 year ago

@goldbergyoni, I'd suggest you to use mongoose and Prisma.

Mongoose: 1.) provides a straightforward
2.) schema-based solution to model your application data 3.) along with built-in type casting 4.) validation, query building 5.) business logic hooks

Prisma: 1.) Strongly-Typed API 2.) Auto-Generated Client 3.) Declarative Schema Language 4.) Support for Complex Queries 5.) Database Migrations 6.) Rich Data Modeling 7.) Developer Experience 8.) Support for Multiple Databases