1.

What is the significance of the “as” field in $graphLookup?

Answer»

First, we have the MongoDB QUERY language.

This is the set of instructions and commands that we have to use to interact with MongoDB.All CRUD operations and the documents that we send back and forth in MongoDB are managed by this layer. They translate the incoming BSON wire protocol messages that MongoDB uses to communicate with the client side application libraries that we call drivers into MongoDB operations.

Then, we have the MongoDB Data Model Layer.

This is the layer RESPONSIBLE for applying all the CRUD operations defined in the MongoDB query language and how they should result in the data structures managed by MongoDB. Management of namespaces, database names, and collections, which indexes are defined per namespace and which interactions need to be performed to respond to the incoming requests are all managed here.

This is ALSO the layer where a REPLICATION mechanism is defined. This is where we define WriteConcerns, ReadConcerns that applications may require. 

Next, we have the storage layer.

At this layer, we will have all the persistence in physical medium calls, how data is stored on disk, what kind of files does it use, what levels of compression amongst other settings can be set. MongoDB has several different types of storage engines that will persist data with different properties, depending on how the system is configured. WiredTiger is the default storage engine. At this layer, all the actions regarding flushers to this, journal commits, compression operations, and low-level system access happens.

  • We also have to traversal layers, which are security and administration layer.
  • All operations regarding user management, authentication, network, encryption are managed by the security layer.
  • All the operations around server administration, like creating databases, renaming collections, logging infrastructure, and such are managed by the administration layer. 
  • MongoDB is also a distributed data management system supporting replica sets and sharded clusters for high availability and scalability respectively.

  • Replica sets are groups of different Mongo Ds that contain the same data. The purpose of a replica set cluster is to ensure high availability and automatic failover. Replica set cluster nodes can have different roles (Primary, Secondary, Arbiter), different hardware configuration, and different operating system. 
  • MongoDB is also a scalable database and allows to segment dataset into shards and grow storage capabilities by adding shard nodes to the cluster. 

Shards themselves are replica sets-- highly availability in units. Where we have other components as well, like:

  • MongoS - which are our shared cluster routing components. MongoSs will be responsible for routing all of our operations and commands to the shards.
  • Shards - MongoDB replica sets where actual data is stored.
  • Config SERVICEA special type of replica set managing all meta-information of our cluster.


Discussion

No Comment Found