3 ms·
Imho the "smell test" for good-enough ORM should be: can I, at the same time, (1) just switch the DB from underneath, replacing a relational MySQL with a docume
by nnq 7y ago
Imho the "smell test" for good-enough ORM should be: can I, at the same time, (1) just switch the DB from underneath, replacing a relational MySQL with a document-oriented DB like Mongo or a hybrid one like Arango and have it work the same, 99% same business logic, (2) replace the underlying DB with a REST API of another app and use that as the DB, and (3) have the ability to drown down to "raw db" language, whether that is SQL, Mongo JSON's based queries, or a GraphQL API I use to "prasitise" another app and use it a the DB for mine?
None of the ORM/ODMs out there come even close to satisfying half of these requirements... so I'd rather implement an app-specific one that does 50% of this for the 1% restricted subset of functionality of the app I have...
- imafish 7y agoI do not think (1) makes sense. Why would you use an ORM for a document-oriented DB?
- nnq 7y ago...well, call it an OWM, Object-to-Whatever-Mapper, but that's what you'd one anyway, document-oriented DB's don't map directly to your business objects either :) I think tackling the most general problem would lead to a way more interesting solution but I have to time to work on this :P