M201 CH5Vid2 contradicts M103

Hi guys,

I’m watching the second video of chapter 5 of M201.

This video says that for sorts/limits/skips across multiple shards, the final sort/limit/skip is performed on “the primary node of the cluster”. I have a number of problems with this wording.

  1. In a sharded cluster, there is NO “primary shard of the cluster”. Each shard will have a primary, but there is no primary shard.
  2. The screenshot below from the video suggest that there is such a thing, but again I don’t think there is.

  1. What’s more, M103 specifically states that the final sort/limit/skip is performed on the MongoS. See M103 CH3Vid12.

Is this particular video outdated? Were “primary shards” something that existed until a few versions of Mongo ago?

@Kanika, do you know who the TA for M201 is? Who could help out with this matter?

@ Tess_Sluijter

Well, I will agree here that the wording (or what is said) might be improved; nevertheless, let me try to clarify this a bit.

First of all, let’s start with the agreement that we are only discussing here a standard, vanilla production-ready system. That is, not a system set up specifically for testing or development and one that fully complies with MongoDB production-ready recommendations. (That’s basically what’s being shown in the lecture). And we will assume that the MongoDB is version 3.6 or later.

Now, to address your various points. First of all, there is a “primary shard” on every sharded database. See the definition here if you’re not familiar. This will be different than the primary of the replica set(s) for the shard(s).

Second, as the documentation here describes, the sharded cluster does use the primary shard rather than the mongos as a place to perform some operations. In general, the final integration will occur on the mongos before routing the documents to the application, but sorts in particular are usually done on the primary shard – although, as you can read, aggregation sorting may not be. (Yeah, well it’s not really that straightforward. :wink: )

All of these are fairly advanced concepts and, as described in the Lecture, intended to be mostly transparent to the application and developers.

Finally, with regard to this being “outdated”, these are all fairly new courses and I would suggest that you assume that the information is current. If there appear to be difficulties, then do by all means post your questions as you have here – we’ll be happy to help.

1 Like

@DHz, David, thank you very much for explaining so thoroughly! I really appreciate you taking your time for this.

I meant no offense with the “outdated” question; I asked, because I’m seeing so much and constant renewal happening on MongoU (with courses being quickly replaced with newer and improved content) that I wanted to rule out the possibility.

@DHz I also want to thank for that clarification. I also reckon having the latest info in a (still) video is quite hard.

@ Tess_Sluijter

No problem, and do feel free to check. Thanks.

1 Like

@ maulberto3

Yes, quite difficult actually – mostly driven by resource constraints. :wink:

That’s why it’s very important that students read the Notes added below the videos (if any) as those can be – and often are – where the curriculum team will update or correct minor issues. Good luck.