MongoDB as a Database
MongoDB is an open source database management system (DBMS) that uses a document-oriented database model which supports various forms of data. Instead of using tables and rows as in relational databases, the MongoDB architecture is made up of collections and documents. Let’s know some brief on MongoDB…
What is MongoDB?
MongoDB is an object-oriented, simple, dynamic, and scalable NoSQL database. It is based on the NoSQL document store model. The data objects are stored as separate documents inside a collection — instead of storing the data into the columns and rows of a traditional relational database. The motivation of the MongoDB language is to implement a data store that provides high performance, high availability, and automatic scaling. MongoDB is extremely simple to install and implement. MongoDB uses JSON or BSON documents to store data. General distributions for MongoDB support Windows, Linux, Mac OS X, and Solaris.
Terminology and Concepts
If you’re not familiar with MongoDB, here’s a quick translation cheat sheet to get you familiar with the terminology:
|Joining||Linking & Embedding|
|Partition||Sharding (Range Partition)|
Should I use MongoDB?
This depends totally upon you which database should you use based on your projects. Here is some pros and cons of MongoDB :
- Document oriented
- High performance
- High availability — Replication
- High scalability – sharding
- Dynamic — No rigid schema.
- Flexible – field addition/deletion have less or no impact on the application
- Heterogeneous Data
- No Joins
- Data Representation in JSON or BSON
- Geo-spatial support
- Easy Integration with Big Data Hadoop
- Document-based query language that’s nearly as powerful as SQL
- Cloud distributions such as AWS, Microsoft, RedHat, dotCloud and SoftLayer etc; In fact, MongoDB is built for the cloud. Its native scale-out architecture, enabled by ‘sharding,’ aligns well with the horizontal scaling and agility afforded by cloud computing.
- A downside of NoSQL is that most solutions are not as strongly ACID-compliant (Atomic, Consistency, Isolation, Durability) as the more well-established RDBMS systems.
- Complex transaction
- No function or stored procedure exists where you can bind the logic
- E-commerce product catalog.
- Blogs and content management.
- Real-time analytics and high-speed logging, caching, and high scalability.
- Configuration management.
- Maintaining location-based data — Geospatial data.
- Mobile and social networking sites.
- Evolving data requirements.
- Loosely coupled objectives — the design may change by over time.
Not so Good For:
- Highly transactional systems or where the data model is designed up front.
- Tightly coupled systems
And there you have it! Now, you’ve got a quick and easy overview of how MongoDB works, some use cases where it can shine, and how it relates to SQL technology. I think I have make it clear that how is MongoDB as database…