4 ms·
Don't think they're going to 'solve' the issue of joins. I think they've taken the decision not to support them. It then becomes an issue of denormalisation, an
by nevi-me 13y ago
Don't think they're going to 'solve' the issue of joins. I think they've taken the decision not to support them. It then becomes an issue of denormalisation, and whether you can actually work on a project with everything denormalised. Otherwise there are some alternatives out there that support joins.
I struggled with the concept of denormalisation, as I came from a hobbyist SQL background, but I managed to build a project based on Mongo and Node (https://rwt.to https://rwt.to), and in the process I went from trying very hard to 'make joins work' to hitting the sweet spot of getting my data 'right'. Mongo certainly ain't meant for everything, and I don't know if they'll ever support joins.
- fourstar 13y agoYeah my site is more social-oriented so I can see how your site may work better with something like mongo (if it's mainly lat/long coordinates). Just as a quick example of something I ran into: When saving comments I liked to save the user's _id, username, along with their avatar so I wouldn't have to do a join later on, but then realized what if the user changes their avatar? Since I store the avatar as a row in the `users` collection, then I'd still need to do one of those nasty fake joins. The post/pre-save methods are pretty bad ass and there are a few things I still do like about mongo (which is why I chose to explore it initially), but I think for social type websites, a sql solution makes more sense. I also scoped @ http://www.rethinkdb.com/ http://www.rethinkdb.com/ which looked interesting, but at this time I wanted to go with a more bulletproof solution to my problems.
- nevi-me 13y agoOne way that I keep my data up-to-date is that when I change something in my "station" data (let's say it's an avatar equivalent) I have an update that's triggered across my "route" collection. So you would likely have to do the same. It works well for me, as the reality is that there's always going to be something that changes and needs to be updated. That's why Mongo has decent update queries.