MongoDB is one of the popular NoSQL database, is an open-source document-oriented database. The term ‘NoSQL’ means ‘not only SQL or non-relational’. It provides an altogether different mechanism for storage and retrieval of data, uses BSON storage format (similar to JSON format) and it is not based on relational database structure.
Advantages and Disadvantages of MongoDB:
Advantages-
- Flexibilty- In MongoDB there is no relation database structure so,we free to use any type data in seperate document,thus it provide freedom to store data of different type.
- High Speed- Speed of MongoDB is 100 faster than relational database because in MongoDB we access documents by indexing because it is document-oriented database.
- Replication- MongoDB has feature of replication in it that increases the performance because it increases data availability in MongoDB.
- High Security- It is a NOSQL database so, it is obviously secure because no sql injection can be made in MongoDB.
- Sharding- It is one of the special feature of MongoDB, Sharding is the process of storing the data in different machines and MongoDB’s ability to process the data, as and when the size of the data grows. This results in the horizontal scaling. If server cannot handle such big data there will be no failure.
Disadvantages-
- Data redundancy– Since there is no functinality of joins so there is data redundancy.
- Memory inefficent– It stores key names for each value pairs, so there is lots of memory used and since limit of document size is only 16MB so it is memory inefficent.
- No Transaction Support- There is no default transaction support, you need to handle this yourself.
- Single threaded- Map / Reduce and aggregation are single-threaded. To be more specific, one per mongod process. Map / Reduce cannot output to sharded collections.
- Size limitation- Max document nesting level is 100 (nested documents), Namespace is limited to 123 chars andDB name is limited to 64 chars.
