How does MongoDB Store Data?
What is MongoDB? MongoDB is a document oriented database. This means it stores its data in fields within a document. Each document can contain a different number of fields making the database highly flexible. You do not have to predefine each column for data that you want to store like you would with a traditional RDBMS system. To understand why you may want to leverage a document database you first must understand how they store data. Data in MongoDB is stored in the following manner:
- MongoDB contains Databases
- Databases contain Collections
- Collections contain Documents
- Documents contain Fields
Unlike a relational database table, each document in a collection can have its own set of fields. You are not required to store the same fields on each document with null values.
When to use a Document Database like MongoDB?
MongoDB has exceptional performance for reading large datasets. This makes it ideal for companies dealing with large datasets that require more processing and heavy read applications: Some examples would include log files, archive data storage or high volume transaction systems such as SCADA.
Specific Use Cases can be found on the MongoDB site: Use Cases
When you reach a limit on processing power you can easily add another node to the cluster WITHOUT having to restart the hardware. This keeps your system up without adding unnecessary outages. In addition to adding more nodes, MongoDB can split data into partitions across nodes. This process known as Sharding, increasing the speeds at which MongoDB can read data and return results.
For Enterprises that have lots of data and are outgrowing the traditional RDBMS systems. MongoDB or other document database solutions could be another tool to leverage to help meet your business requirements. If you have not investigated document databases before, take the time to learn more about them.