Introduction to MongoDB

Introduction to MongoDB

MongoDB is a popular Opensource NoSQL and document-based database. MongoDB’s documents are structures in JSON with the proper schema. MongoDB is available as Cloud platform called MongoDB Atlas and Software as MongoDB server. Then, Along with this, MongoDB provides Analytics Platform for Cloud Service. So, In this article, we will see the Introduction to MongoDB.

Support Platform and Community

As MongoDB is Popular among the NoSQL platforms, it has active community for support. Visit MongoDB Community Forum.

For Cloud version MongoDB, Login in to MongoDB Cloud Account and raise your requests. For MongoDB Support platform, visit MongoDB Support Portal.

Then, Technical support questions can be raised as a ticket in here MongoDB Support Portal. MongoDB issues can be raised and tracked using JIRA tickets. Follow the link for more instructions on JIRA Tickets.

Get-Involved with MongoDB is a community where you can build relationship with community of like mined people and grow skills in-cooperated with MongoDB.

MongoDB provides many ways to learn and sharpen your skills.

As we discussed, MongoDB provides both Community and Enterprise version of NoSQL database. So, In this article, we will consider the MongoDB Community edition for our learning.

A Simple Comparison with Relational Database

As Part of Introduction to MongoDB, we will discuss some comparison of MongoDB with RDBMS.

Concepts of MongoDB.

MongoDB works on concept of:

  • Database
  • Collection
  • Document

Database

Database in MongoDB is the physical container of the data. Then, In a single MongoDB server, multiple databases are available, and each database has a files system and set of files in it.

Collection

Collection in MongoDB is the group of database document. Actually, We can compare this collection as tables in Relational Database but there is no schema structure in the collection but documents have it. Unlike the Relational Database, MongoDB can have different fields in the same document but documents in the same collection are meant to be stored to serve the same purpose.

Document

The document is the set of key-value pairs (essentially in JSON format). Every document is having dynamic schema structure. It means, every single document in the collection may have different structure or fields and if the two documents are having a same or common field. Then, it may not be having the same type of data in it.

Sharding of MongoDB.

MongoDB Architecture
MongoDB Architecture

Mongos

Mongos is the component that acts as the interface between client and shard clusters. Then, This Mongos instance connects with Config servers to determine which shard should respond to which query.

Config Server

Config Server contains the metadata of chunk of the data in every shard. Then, This will keep connecting in a redundant way with every other component of the DB to ensure mangos can respond with requested data at any time.

Shard

Sharding is the concept of distributing data across multiple machines. Which means, Scaling or addressing the system growth of the mongoDB. Essentially, it has two methods of scalling

  • Vertical Scaling: This will increase the capacity of a single server like CPU power, adding more RAM, or increasing the amount of storage space.
  • Horizontal Scaling: This will divide the system dataset and distribute over multiple servers, adding additional servers to increase capacity as required.

Replica set

Every shard is deployed as Replica set which is the cluster of MongoDB servers that implements the automated failover and replication.

Simple Example of MongoDB Document

Below is the simple example of MongoDB Document.

{
   _id: ObjectId(6c38d47de4c3)
   title: 'Introduction to MongoDB', 
   description: 'This is the MongoDB Example document',
   by: 'DigitalVarys,
   url: 'http://digitalvarys.com',
   tags: ['mongodb', 'database', 'NoSQL'],
   Topics: [	
      {
         Title:'Introduction',
         Description: 'Introduction of the MongoDB',
      },
      {
         Title:'Support Platform and Community',
         Description: 'Links to all MongoDB Community',
      },
      {
         Title:'Concepts of MongoDB.',
         Description: 'Explains the Basic concept of MongoDB',
      },
      {
         Title:'Sharding of MongoDB',
         Description: 'Explains the concept of Replication',
      },
      {
         Title:'Importance of MongoDB Technology',
         Description: 'Explains the importance and advantages of MongoDB',
      },                  
   ]
}

_id is the unique 12 bytes hexadecimal number. It is like ID in RDBMS. Others are key-value pare of data.

Importance of MongoDB Technology

MongoDB has many advantages over other traditional databases. In which “scalability” is one important aspect to consider MongoDB. Other important reasons that we need to consider MongoDB is follows

  • Distributed Data Platform: Data can be distributed across global if you properly set up the system.
  • Text search: Out of the box feature called Text search enables data into application layer without effort.
  • Flexible Data Model: MongoDB supports Dynamic schema which will not restrict developers to change in structure at any point.
  • Fast and Iterative Development: As MongoDB support change and adopt changes development of the project can be faster and Agile.
  • Integrated features: Features like Analytical platform, data visualization, event-driven streaming data pipeline, text and geospatial search, graph processing, in-memory performance, and security are helping developers implement without additional efforts of integration
  • Economical and Cost-effective: Then, Compare to other database systems, MongoDB is Cost-effective, and support and maintenance are very economical.

Conclusion

In this article, we have discussed the introduction to MongoDB and its features, concepts, architecture, and Importance of MongoDB. Then, In our upcoming article, we will discuss detailed working concept and tutorials of MongoDB and series of MongoDB tutorials. Stay tuned and subscribe DigitalVarys for more articles and study materials on DevOpsAgileDevSecOps and App Development.

1 thought on “Introduction to MongoDB”

Leave a Reply