MongoDB

Published: 2021-12-23 14:58:39

**Introduction:**
As a backend developer, you can use MongoDB Realm to quickly develop cloud-based applications. Realm apps can respond to changes to your MongoDB Atlas data, connect that data to other systems, and scale to meet demand. This means that MongoDB is not based on a relational database structure like a table but provides a completely different process for data storage and retrieval. This format of storage is called BSON ‘similar to JSON format’.
Relational database management systems (RDBMS) are not the right choice when it comes to handling big data due to their design quality as they are not horizontally scalable. If the database runs on a single server, it will reach a scaling limit.

**Relational Database Management System vs MongoDB:**
RDBMS has a simple schema design that shows the relationship between the number of tables and this table where MongoDB is document-based. No idea of ​​schema or relationship.
Complex transactions are not supported on MongoDB because complex join operations are not available.
There are several related terms in both databases. In RDBMS, what is called a table is called a collection in MongoDB. Similarly, a tipple is called a document and a column is called a field. MongoDB provides a default '_id'  which is a 12-byte hexadecimal number that ensures the uniqueness of each document. It is like the primary key of RDBMS.

**Features of MongoDB:**
Document Oriented: MongoDB preserves the core content in a minimal number of documents and does not divide it into multiple relational structures like RDBMS. For example, it stores all of a computer's information in a single document called a computer, and not in separate relative structures such as CPU, RAM, hard disk, etc.
Scalability: Scale horizontally (partitioning data across different servers) using MongDB Sharing. The data is divided into data segments using the shard key, and these data segments are evenly distributed across the shard that resides on many physical servers. Also, new machines can be added to a running database.
Copy and High Availability: MongoDB increases data availability with multiple copies of data across different servers. Provides redundancy, it protects the database from hardware failure. If one server goes down, data can be easily recovered from other active servers on which the data was stored.
**Where do we use MongoDB?**
If you have a lot of data stored on the table, think of MongoDB before the RDBMS database. MongoDB has built-in solutions for partitioning and sharding your database.
It is difficult to add a new column to RDBMS where MongoDB is schema-less. Adding a new field does not affect the old documents and it will be much easier
Since multiple copies of data are stored on different servers, data recovery is instant and secure even if there is a hardware failure.
**Language Support by MongoDB:**
MongoDB currently provides official driver support for all popular programming languages ​​such as C, C ++, Rust, C #, Java, Node.js, Perl, PHP, Python, Ruby, Scala, Go, and Erlang.
 
**Installing MongoDB:**

Just go to http://www.mongodb.org/downloads and select your operating system from Windows, Linux, Mac OS X and Solaris. A detailed explanation of the installation of MongoDB is provided on their site.For Windows, some options drop down for 64-bit operating systems. When you are running Windows 7, 8 or later, select Windows 64-bit 2008 R2 +. Select Windows 64-bit 2008 R2 + Legacy when you are using Windows XP or Vista.


**Conclusion:**
MongoDB is an open source NoSQL database management program. NoSQL is used as an alternative to traditional relational databases. Distributing NoSQL databases is quite effective for working with large sets of data. MongoDB is a tool for managing, storing or retrieving document-based information.