Go to work with MongoDB. What is it and How does it work?

Tre'von Mitchell
4 min readAug 23, 2021

--

Introduction.

Is this your first time going through a coding Bootcamp and starting on the back end of an application, working on the server-side, and could be using MongoDB? Well, here In this blog I will go over a quick overview of MongoDB and why it's useful.

What is MongoDB?

If you have checked out my last blog post then you know MongoDB is a document-oriented, no sequel database. It replaces the whole concept of rows of relational data models with documents that give the flexibility to work with evolving data models. MongoDB allows embedded documents arrays and represents complex hierarchical relationships using a single record. This database is Schema free, which means that the keys defined in the document are not fixed. So instead of using tables and rows, MongoDB is formed of collections and documents, which means it is not a structured query language. This means you don’t have to define the data structure of the database or create the schema before using it. Massive data migrations can be ruled out. If you ever come to the MERN stack, the M stands for MongoDB.

Why use MongoDB?

You are probably wondering why should you use MongoDB, well for one is because of flexibility. MongoDB’s notion of documents that contain sub-documents that are nested in complex hierarchies is flexible. So a user can select some part of a document or query based on attribute values regular expressions. Another reason to use MongoDB is native aggregation, which means it allows users to extract and transform data from MongoDB. That is what makes it extremely compatible. Just like what I mentioned earlier in this blog is that MongoDB has a Schema free model. Why is that? Well, applications get to interpret different properties in different ways. The MongoDB schema is not required to store information.

Characteristics of MongoDB.

You can note that MongoDB is a general-purpose database, so it can serve multiple purposes within an application. Again, MongoDB has a flexible schema design with non-defined attributes that can be modified on the snap, which is a key contrast between MongoDB and any other relational database. MongoDB is built to scale both vertically and horizontally using sharding and can share the load between different instances and achieve both read and write scalability. The horizontal method is used to increase system performance, adding more server to the cluster. The whole concept is to better overall performance and disc space for data storage. What is a cluster? a cluster can have a huge number of servers or a number of a replica set. I also mentioned about the aggregation framework, MongoDB offers an extract transform and load framework that eliminates the need for complex data pipelines.

The working of MongoDB.

Here I will go over a quick review on how does the MongoDB works. You should know that the data in MongoDB is stored in documents with the help of key value pairs. In the back end of an application, MongoDB converts JSON data into a binary format known as BSON. BSON stands for Binary JSON and is just objects or JSON-like documents. All of the documents are stored in a collection, and the collections hold multiple documents and since MongoDB is Schema-less the documents in one collection may not be similar. Once again, the collections are stored in the entire MongoDB database and MongoDB makes provision for nested data which makes fetching for data efficient when you compare it to other databases.

Applications of MongoDB.

MongoDB can be applied or used for several areas of technologies and use MongoDB as their dbms. Some of them are Internet of Things, Mobile of applications, Real time analysis, Personalization, Catelog Management, and Content Mangement.

Companies Using MongoDB.

Companies that use MongoDb are Toyota, SAP, AstraZeneca, Adobe, Verizon, Barclays, Google, and others that deploy MongoDB as their database management system.

Conclusion.

There is a lot of information to go into MongoDB, but this was just quick overview of what MongoDB is about. I hope this overview and information is helpful for when starting on MongoDB and using the database. Check out more on the backend and using MongDB to get data with the server.

--

--

No responses yet