Introduction To MongoDB — NoSQL Database
In this article we will discuss very basic and formal introduction to what MongoDB is? how data stored in MongoDB and how it is different from SQL databases?
So, let’s start from the very basic question what the actually mongoDB is?
MongoDB
MongoDB is NoSQL Document Database, NoSQL is generic term which means database which doesn’t use legacy approach to store data in related tables.
This means to you store data in structured way but not in related tables (rows and columns) of data. The data stored in mongoDB as documents and documents stored as collection.
Note: MongoDB stores data as BSON (binary representation of JSON data) documents. BSON have more types than JSON. It has more advantages over JSON. You can see the docs → https://bsonspec.org/
BSON has three main characterists
- lightweight
- Traversable
- Efficient (encoding and decoding is easy due to the use of C language data types )
Collection
Collection is organized store of documents in mongoDB usually with common fields between documents. There can be many collections per database and many documents per collections.
Note: Collection is similar to table in SQL database.
Document
A way to organize and store data as set of field-value pairs.
Field
A unique identifier for a data point.
Value
Data related to given identifier
Conclusion
We have come across the concepts related to mongoDB which usually confusing and it is getting started article with mongoDB. We talked about MongoDB, collection and documents. If you have any question you can ask thanks for reading this article.
References: MongoDB University