Chapter1 Quiz 1

The question is as follows:

Why is MongoDB a NoSQL database?

The answers expected includes

Because it uses a structured way to store and access data.

This seems incorrect since a SQL database is also structured.

MongoDB is one of the types of database management systems that exists today. The reason of the existence of a DBMS such as MongoDB is to attend or resolve some sort of issues or new requirements where other types of DBMS will give a poor response or no response at all, or yet, will take a considerable amount of effort and resources.

There is a structure query language for a DBMS like MongoDB, it is called MSQL. The MSQL is specific to MongoDB and the internals of its data structures.

The data structures of a document database such as MongoDB are different from those of a relational database or a graph database, and the internal workings of each other are different as well. Not withstanding, you can relate data in MongoDB in its proper way as you would in a relational database proper way.

So, when you see “NoSQL” you can think of a DBMS that was engeneered different from a relational database model, not that it does not uses a Structured Query Language, or that does not use data structures to hold the data. Keep in mind that all types of databases must use data structures to hold the data.

Jaime :space_invader: :coconut:

1 Like

Hi @Mark_Visschers and @jhrozo,

This is a great discussion, thank you for bringing it up. The question itself is a check all that apply question, meaning that you select all options that are correct about a statement.

The structure of the lesson that precedes this question states that MongoDB is a database, which by definition is just a structured way to store data. The structure differs from one database to another, but it is always present, otherwise, we wouldn’t call it a database, but a data dump instead.

We had a great discussion on this topic in this thread if you’re interested to learn more. @jhrozo’s response touches on some of the things that we discussed there.

Below is my response to the linked thread for reference.

" This is a great discussion thread, and I would love to weigh in and see what you think about all this.

There are a couple of things on the internet that give people the wrong impression about MongoDB. The first thing is that it is non-structured. By definition, if something is a database, then there is a structure in how the data is stored. This structure could be related tables of data, graphs, key-value pairs, or an alphabetized set of library cards. If there wasn’t structure to the way that the data is stored, it wouldn’t be a database, it would be a datadump of some sort. For example my history notebook from highschool is an unstructured way to store data. There is no way to find information in that notebook other than reading through every single page of it and hoping to find a scribble of relevant information.

This conversation earlier mentioned non-structured query language . The language that is used to query the database is a separate topic. In theory, anything that is not SQL is a non-structured query language, but not because it lacks some sort of structure, but because SQL called dibs on the word structured . It is literally in its name Structured Query Language. When people want to refer to any querying language that is non-SQL they simply say “unstructured” instead of saying MQL, GraphQL, etc.

Another misconception that is floating around the web is that MongoDB is schemaless. Meaning that it lacks schema altogether, and it adds to the misconception that MongoDB doesn’t have relationships. These are not true. MongoDB can easily store related data, enforce schema, and demand structure from the way the data is represented and stored. The key difference here is that there is flexibility in how the schema and relationships are being designed and used, and it isn’t uniform for everyone. Whereas in the world of related tables, there is a strict formula by which related data needs to be organized, and there is no other way to do it, hence, the lack of flexibility in the approach.

Some applications need to ability to have optional fields and a variety of data types in their data, others don’t and MongoDB can accommodate for both by using good data modeling practices, and schema validation rules.

Let me know if you have questions about any of this or if I wasn’t clear at some point in this post.

Hope this helps clear things up a little."

1 Like

Thank you for your extensive response, really appreciate it!
The information provided is very extensive and clears a lot up. I think it is really important info and I get that people might mistake mongo as unstructured just because the “S” in SQL.
I will definitely look into the provided thread to learn more on this topic.

What threw me off was the NoSQL - Database part in the question. For me it would be more clear if it was a separate question like: “Is Mongodb a structured or unstructed database?” or “What is true about MongoDb?” with the same answers applying. This way NoSQL part is separated from the database part.

But I am actually glad that it was a little confusing for me, otherwise I would have missed this extensive answer which provided me with a lot more information!

Thank you both again!

1 Like

Thank you for your extensive answer. The “S” would throw somebody off without this information. The information that you provided will make sure I will look at mongo or any other NoSQL database, in the right light.

1 Like