课程: Advanced MongoDB: Efficient and Secure Data Management

今天就学习课程吧!

今天就开通帐号,24,100 门业界名师课程任您挑!

Solution

Solution

(upbeat music) - [Instructor] To figure out how to shard the filme collection, let's first look at a sample document in the collection. Now this collection only has five values in it, so this is mostly a theoretical exercise. So these are the fields that we've got available. We've got the title, the release date, the length in minutes, the genre, and the description. So genre is close to the example that we discussed in previous videos, and I think that might make a good shard key depending on how many movies we have for each genre and how far we need to shard. But given the limited amount of information we have about the size of this collection, I think genre would be a good start. Now let's look at some of the other ones. So we could also shard on the title potentially depending on what the most common queries are, that might be a good one if people generally search by title, but that only really works if they specify…

内容