5
KALALEX
11d

Like seriously how fucked up are those ORMs? Prisma “yeah we support mongodb, but we will force you to write in a relational way.” I always hit on hard walls whenever ever I try an ORM in my projects.

Don’t get me wrong they are good for dummy stuff. But if you want to go a little bit crazy with mongo, embedded documents with refs it’s a mess…

Typescript and good old mongodb adapter bb anything else.

Comments
  • 4
    Wtf? Why do you even need orm if you have a non relational db? The whole point of an orm is to map from relational to hierarchical.
  • 0
    @Lensflare that is one use, why not map object interfaces to collections to inherit type safety only in places you want to? Isn’t that the premise of prisma supporting a document database? If not the I don’t get why prisma bothered even doing a mongo support feature.
  • 0
    @KALALEX i don’t know prisma, but the term orm is literally object relational mapping. When the relational part is missing, then it’s not orm. So it might be just that I was confused by the terminology. Of course it makes sense to do the type safe mapping.
  • 1
    or don't ever choose mongodb

    like ever
  • 0
    @fullstackcircus what’s your problem with mongodb?
  • 0
    @Lensflare why depart from ACID when you can get ACID and better performance than mongodb?
  • 0
    @fullstackcircus i'm speaking of course of postgres
  • 0
    @Lensflare making sense of relationships between generated objects (POJOs, Classes etc) which map to “entities” of a data system (RDB, DocDB etc). Now how those relate to each other in the data system should be abstracted at ORM usage level, using ex methods to get data. That is the premise from my understanding.
  • 0
    @fullstackcircus are you a time traveler from the past? 🥸 Because mongo supports acid transactions, it arrived as a COVID mutation. Something like ghouls in fallout.
  • 0
    @fullstackcircus because postgres is relational. Not every use case needs a relational db.
  • 1
    Seems like you can drop the R and just go with an object mapper. I only really know c# mappers, but I’m assuming you can get type safe ones in TS too.
  • 0
    @Lensflare I've yet to see such case
  • 0
    @fullstackcircus just because you CAN use a relational db for everything, doesn‘t mean it’s the best fit. There are countless examples of use cases. A simple google search revealed that Netflix uses NoSQL DBs, for example.

    Most devs just pick relational by default and that‘s the major problem.

    Be a good dev and pick the right tool for the job.

    I would even go so far and say that in most cases, a no-sql db is the better choice.
Add Comment