|
|
|
|
|
by dbcfd
4597 days ago
|
|
> Keep in mind the constraints in the article, for example: some shows have 20,000+ episodes, actors show up in 100s of shows, and "We had no way to tell, aside from comparing the names, whether they were the same person". As others have pointed out, it requires two trips to the database. Given their architecture (distributed nodes), network latency is minimal, so this is essentially two calls to the database. show {
_id,
title
} actor {
_id,
appearedIn : [id]
} db.find({"title":"awesomeshow"},{"_id":1})
db.find({"appearedIn" : showId}) Each actor is unique in the database, when you query, you get back unique actors. I'm not sure why they're scared of joins (or multiple queries in mongo). The question you ask yourself is not whether you're joining, but how often you're joining. If you're not joining often on actors and shows, document databases can work better, since you represent the show and all its episodes without having to join. |
|