Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not 100% parallel, but I was debugging a slow endpoint earlier today in our app which uses Mongo/mongoose.

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



> 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.


Maybe because mongo isn’t ideal for relational data?


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.


Does mongodb optimize joins at all? Do they even happen server side?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: