MongoDB Document
MongoDB Document
MongoDB Features
1) Each database contains collections which in turn contains documents. Each
document can be different with a varying number of fields. The size and content of
each document can be differe nt from each other.
2) The document structure is more in line with how developers construct their classes
and objects in their respective programming languages. Developers will often say that
their classes are not rows and columns but have a clear structure with key-value pairs.
3) The rows (or documents as called in MongoDB) doesn’t need to have a schema
defined beforehand. Instead, the fields can be created on the fly.
4) The data model available within MongoDB allows you to represent hierarchical
relationships, to store arrays, and other more complex structures more easily.
5) Scalability – The MongoDB environments are very scalable. Companies across the
world have defined clusters with some of them running 100+ nodes with around
millions of documents within the database
Overview
Sample Document
Above example shows the document structure of a blog site, which is simply a
comma separated key value pair.
Advantages of MongoDB
Any relational database has a typical schema design that shows number of tables and
the relationship between these tables. While in MongoDB, there is no concept of
relationship. Advantages of MongoDB over RDBMS can be described as:
MongoDB has document oriented storage; data is stored in the form of JSON style
documents. It can be indexed on any attributes. We can also explain where to use
MongoDB:
Big Data
Content Management and Delivery
Mobile and Social Infrastructure
User Data Management
Data Hub