MongoDB database is one of the fastest growing database. It is an open-source, document based and leading NoSQL database with the scalability and flexibility that you want with the querying and indexing that you need.

In this article, I will discuss, why you should prefer MongoDB over another databases?

I will cover these 7 points in this article.

1. Growth of MongoDB

2. Flexible Data Model

3. MongoDB features

4. Rich set drivers and connectivity

5. Availability & Uptime

6. Elastic Scalability

7. Security

1. Growth of MongoDB:

MongoDB is one of the fastest growing and very popular database. Let me cover this one by one.

Fastest-Growing Database

MongoDB is growing faster in comparison to other databases on all the platforms like Google, Facebook, Twitter and LinkedIn.

Popularity of MongoDB

MongoDB is the most popular database these days. It is fastly ranked among other databases.

As this is fast growing database it is important for someone to use it now then later.

2. Flexible Data Model:

MongoDB is having flexible schema model. Mogodb internally does not have any schema. So a developer it is really easy to change the data model in the applicaton at any time. It is specially helpful when we work in Agile enviormnent.

Developer Costs on the Rise

Above graph show compersion between 1985 to 2013. Developers cost is increasing and storage cost in coming down big time. Development using mongodb is faster then compared to any other database. Mongodb takes little more storage then other databases.

Optimizing for Engineering Productivity

Again this image shows cost breakdown between engineering cost vs Infrastructure cost. As we see trend of companies spending lessor ratio on enginners in 2013. So it is important to spend less on development rather then focusing on core business.

Document Model with Flexible Schema

Let me show you a example how to store data of cars and person associated with it. In RDBMS we need two tables in this. And CAR table will need a foreign key to PERSON table. This makes it legthy for a developer to store data and query relevant information later on. See the data model below.

On the other hand this is how we can store this information in Mongodb

{ first_name: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: [45.123,47.232], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 { first_name : ‘ Paul ’ , surname : ‘ Miller ’ , city : ‘ London ’ , location : [ 45.123 , 47.232 ] , cars : [ { model : ‘ Bentley ’ , year : 1973 , value : 100000 , … } , { model : ‘ Rolls Royce ’ , year : 1965 , value : 330000 , … } ] }

Documents are Rich Data Structures

Mongodb supports every type of data types. we can store string, Numbers, Booleans, Array, Objects and Geo-locatoons.

Development – The Past vs WIth MongoDB

As you see in the images. Development cycle has improved alot using mongodb. We are able to cut down several steps.

3. MongoDB Features:

Mongodb is feature rich compared to other noSQL databases. With compared to MySQL as well it is feature rich. It has featured like Auto sharding and the queries which is really complex in RDBMS, can be easy in Mongodb. See the comparsion table below.



Features compare of My SQL and MongoDB

Dynamic Lookup



Query combine data from multiple collections with left outer joins for richer analytics & more flexibility in data modeling.

Model of the Aggregation Framework

Richer In-Database Analytics & Search

New Aggregation operators extend options for performing analytics with lower developer complexity.

4. Rich set drivers and connectivity

Mongodb has rich set of drivers, that makes it easy to use mongodb with any framework.

Drivers & Frameworks

Mongofb has drivers for every language. We have offical drivers for Java, Ruby, Python, Perl, .Net, Php, C++, C, Scala and Node,js.

In Popular frameworks like MEAN stack M stands for Mongdb. Mongodb also has support in Hibernate ORM.

MongoDB Connector for BI

Mongodb db provide connectors for Many BI plateforms.

Visualize and explore multi-structured data using SQL-based BI platforms.

5. High Availability & Uptime

Mongodb ensures 99.99% Uptime. To ensure this we can create Replica sets and shards.

Replica Sets

1. Replica set – 2 to 50 copies

2. Makes up a self-healing ‘shard’

3. Data center aware

4. Addresses:

– High availability

– Data durability, consistency

– Maintenance (e.g., HW swaps)

– Disaster Recovery

In next images it is showing the replica sets work in Mongodb.

Replica Set – Initialize

Replica Set – Failure

Replica Set – Failover

Replica Set – Recovery

Replica Set – Recovered

6. Elastic Scalability

Elastic Scalability with Automatic Sharding

1. Increase or decrease capacity as you go

2. Automatic load balancing

3. Three types of sharding

– Hash-based

– Range-based

– Tag-aware

Query Routing

1. Multiple query optimization models.

2. Each of the sharding options are appropriate for different apps/use cases.

Designed for Performance

Mongodb is designed for giving fast performance. It is cool features like better data locality, in memory caching anf in place updates.

Performance at Scale

Performance comparison in marketting, government and investment backs.

7. Security

Mongodb is very secure database, it has enterprise grade security. It support lot of protocals for authorizations.

Enterprise-Grade Security

Habilelabs is the official MongoDB partner, Contact Us for project related queries. Download this content in PDF format at SlideShare.

For any questions or suggestions drop me a line in a comment section.

I hope you found this article helpful, share it on social media.

Checkout the presenations at SlideShare Here: