Data Storage in MongoDB
5.1 Collections
A database can contain as many collections as it wishes, and MongoDB stores data inside collections.
As an example, a database might contain three collections a user’s collection, a blog post collection, and a comments collection. The user collection would hold user data and documents, the blog post collection would hold blog posts and documents, and the comments collection would hold documents related to comments. This would allow for the easy retrieval of all the documents from a single collection.
5.2 Documents
Documents themselves represent the individual records in a specific collection.
For example inside the blog posts collection we’d store a lot of blog post documents and each one represents a single blog post now the way that data is structured inside a document looks very much like a JSON object with key value pairs but actually it’s being stored as something called BSON which is just binary JSON.
MongoDB Architecture
MongoDB is a popular NoSQL document-oriented database management system, known for its flexibility, high performance, high availability, and multi-storage engines. The term NoSQL means non-relational. It means that MongoDB isn’t based on a table-like relational database structure. It is used by Adobe, Uber, IBM, and Google. In this article, we will delve into the MongoDB architecture, exploring its key components and how they work together.