4 ms·
Using an ORM/ODM is best practice in almost any environment.
by wprl 13y ago
Using an ORM/ODM is best practice in almost any environment.
- corresation 13y agoWith MongoDB/Mongoose there absolutely are types and structures. Most applications grow to the point that they have multiple database clients (it is a virtual inevitability). Utilities that have to do something. Integration points. Etc. In an ideal world these can all be completely tunneled through an API, but that is seldom the practice (different needs, different maintenance cycles, etc), whether in a RDBMS or a document model. Above and beyond that, most applications see technical variations and evolutions of the things that contact it. Today you might be enamored with nodejs, tomorrow it's Go, and the next day it's noderust, etc. Having a technology-coupled surrogate for basic database functionality isn't a sustainable approach.
- Wintamute 13y agoMongoose mainly just provides a handy programmatic API in Node.JS to native MongoDB features. The querying power and types/structure (derived mainly from its inherent JSON-ness admittedly) are part of MongoDB, not the software around it.
- throwaway1979 13y agoUmm .., no .. if you have a large number of tables and need ACID compliance, I've found ORMs to be horrid. They hide a lot of details, which cause massive performance headaches later on. I just noticed you said almost. Maybe this is the exceptional case you were thinking of :)