What is MongoDB?
MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need
MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is free and open-source, published under a combination of the GNU Affero General Public License and the Apache License.
Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents.
{
name : “Ravi” field: value
age: 26 field: value
}
Key Features
High Performance
MongoDB provides high performance data persistence. In particular, Support for embedded data models reduces I/O activity on database system.
Rich Query Language
MongoDB supports a rich query language to support read and write operations including Create, Retrieve, Update, Delete (CRUD)
High Availability
MongoDB’s replication facility, called replica set, provides:
automatic failover
data redundancy.
A replica set is a group of MongoDB servers that maintain the same data set, providing redundancy and increasing data availability.
Horizontal Scalability
MongoDB provides horizontal scalability as part of its core functionality:
Sharding distributes data across a cluster of machines.
MongoDB 3.4 supports creating zones of data based on the shard key. In a balanced cluster, MongoDB directs reads and writes covered by a zone only to those shards inside the zone.
Support for Multiple Storage Engines
MongoDB supports multiple storage engines, such as:
WiredTiger Storage Engine and
MMAPv1 Storage Engine.
Indexing
Fields in a MongoDB document can be indexed with primary and secondary indices.
File storage
MongoDB can be used as a file system with load balancing and data replication features over multiple machines for storing files.
Server-side JavaScript execution
JavaScript can be used in queries, aggregation functions (such as MapReduce), and sent directly to the database to be executed.