Maybe because mongo isn’t ideal for relational data?
Does mongodb optimize joins at all? Do they even happen server side?
I believe a lot of Mongo's criticisms come from people modelling highly relational data on a non-relational DB.
I'm not sure what is the point of using MongoDB these days, when you can as easily store and query jsonb in postgres.
Re:Migrating to Postgres
by lelanthran on Thursday May 15, 2025 @07:23AM
(#43993858)
> I removed a $lookup (the mongodb JOIN equivalent)
There is no "MongoDB JOIN equivalent" because MongoDB is not a relationalal database.
It's like calling "retrieve table results sequentially using previous table's result-set" a JOIN; it's not.
I removed a $lookup (the mongodb JOIN equivalent) and replaced it with, as Prisma does, two table lookups and an in-memory join
p90 response times dropped from 35 seconds to 1.2 seconds