MongoDB Architecture

Hello Everyone,

I have a question regarding MongoDB architecture.

For MQL Layer, instructor said “For all CRUD operations and the documents are managed by this layer” .(What is being managed here ? what instructor is trying to say by manage word here ?) .

For MongoDB document data model layer, instructor said,“This layer is responsible for applying (What is the meaning of apply ?) all the CRUD operations defined in the MQL Layer.”

If MongoDB document data model layer is responsible to apply the CRUD operation then how it is differ from the CRUD operations managed by MQL layer.

Please help me to understand these terms such as “Manage” and “Apply”.

Thanks,
Bhavik

Hi @bhavikmunjani,

In the lecture video, we mentioned:

“All CRUD operations and the documents that we send back and forth in MongoDB are managed by this layer”

This means, that we use the CRUD operations to interact with our data.

MongoDB Query Language, is a set of instructions and commands that we use to transact with MongoDB .
All the CRUD operations (create, read, update, delete) which are basically the instructions/operations are a part of MongoDB Query language and are used to interact with our data.
This is the set of commands that we use to query the database to fetch some information or to modify our documents.
Hence, it says that all the CRUD operations are ‘managed’ by this layer.

If you want to learn more about CRUD operations, please refer to our docs.

A data model generally defines how the logical structure of a database is modeled and data flow between different data elements.
Therefore, the MongoDB document data model is responsible for management of all kinds of data structures like collections, namespaces, etc. onto which we apply our CRUD operations to get desired documents(data structures) or to manipulate the existing data structures.

Data modeling concepts can be well understood through our documentation here.

To sum up, MongoDB query language consists of a set of instructions through which we manage our CRUD operations to be applied on the data structures or documents, etc. which is termed as document data model layer (used to define the logical structure and management of data storage entities).

Hope this helps! Please get back to me if you have any further queries.

Thanks,
Muskan
Curriculum Support Engineer

Hello Muskan,

Thanks a lot for the nice brief.

Actually I am still confused regarding “managed” word with respect to MQL.

I understood that CRUD commands are the part of Mongo DB query language and these are the commands by which we can “talk” with the database.

But as the “manage” word is come into the picture, I am unable to get the context.

  1. Is MQL layer is providing any execution environment to the CRUD operations where they can get execute ?

I am trying to figure out what kind of management is being done at MQL layer for this CRUD operation.

Thanks,
Bhavik

Hi @bhavikmunjani,

As mentioned in the lecture video, the translation of the incoming BSON wire protocol messages that MongoDB uses to communicate with the client side application libraries into MongoDB operations happens at the MQL layer.

Thanks,
Muskan
Curriculum Support Engineer

Hello Muskan,

Thank you for the brief !! And I am sorry to bother you.

But, the answer you gave is correct with respect to MQL but somehow, it is not answering what I am trying to understand.

Well, let me try to ask it again.

For MQL, instructor said “All CRUD operations and the documents are managed by this layer that is MQL layer”.

Here I know what is CRUD (Create, Read, Update, Delete) operations and what is the document.

One thing I unable to get context is the usage of word “manage”.

What instructor is trying explain by using word “manage

Thanks,
Bhavik

Hi @bhavikmunjani,

The MQL server converts each MQL query to one or more MongoDB queries. Specifically joins and some types of subqueries are broken into several queries.

To explain this further, consider you have written a nodejs code for inserting a document in MongoDB like:

await users.insertOne({ ...userInfo }, { w: "majority" })

MQL layer converts this code to BSON wire protocol messages that MongoDB understands like db.users.insert({})…

In simple words, it will translate Driver’s output (Human written queries) to MongoDB Query Language (MQL) commands like insert, delete etc which MongoDB server can understands.

This is what our instructor meant when he said “managed by this layer”.

For MongoDB document data model layer, instructor said, “This layer is responsible for applying (What is the meaning of apply ?) all the CRUD operations defined in the MQL Layer.”

After MQL has converted the code to commands like insert query, now Data Layer will apply all the necessary filters, sort the data, look for indexes, apply read/write concerns etc.

I hope this answers your question in a better way.

You may also take a look at the following for reference:

Thanks,
Muskan
Curriculum Support Engineer

Hello @Muskan_Sharma

Yes, now I understood. :slight_smile:

Thanks a lot for the brief.

I appreciate the efforts you have made to answer my query.

Regards,
Bhavik

1 Like