What is MongoDB?
MongoDB is a document-oriented database that stores data in documents similar to JSON.
MongoDB's design philosophy is to meet the demands of large data volumes, high performance, and flexibility.
MongoDB uses collections to organize documents, and each document is composed of key-value pairs.
- Database: A container for storing data, similar to a database in a relational database.
- Collection: A collection within a database, similar to a table in a relational database.
- Document: A data record in a collection, similar to a row in a relational database, stored in BSON format.
MongoDB stores data as a document, and the data structure is composed of key-value pairs. Documents are similar to JSON objects; field values can contain other documents, arrays, and arrays of documents:
Key Features
-
Document-oriented storage: MongoDB is a document-oriented database that stores data in a JSON-like format, making the data structure more flexible and richer.
-
Index optimization for queries: MongoDB allows users to create indexes on any attribute in a document, for example
FirstNameandAddress, thereby improving query efficiency and sorting performance. -
Data mirroring and scalability: By creating data replicas locally or over the network, MongoDB achieves powerful data redundancy and scalability.
-
Horizontal scaling and sharding: Facing increased load, MongoDB can distribute data to other nodes in the computer network through sharding technology to achieve horizontal scaling.
-
Powerful query language: MongoDB uses a JSON-format query syntax and supports complex query expressions, including queries on embedded objects and arrays.
-
Data updates: Using
update()command, MongoDB can replace an entire document or update specified data fields, providing a flexible way to update data. -
MapReduce batch processing: MongoDB's MapReduce feature is designed for large-scale data processing and aggregation operations. Through the Map function's
emit(key, value)invocation and the logical processing of the Reduce function, it achieves efficient data aggregation. -
MapReduce scripting: Map and Reduce functions are written in JavaScript and can be executed in MongoDB using the
db.runCommandormapreducecommand. -
GridFS large file storage: GridFS is a built-in MongoDB feature for storing and retrieving files larger than the BSON document size limit, such as images and videos.
-
Server-side script execution: MongoDB allows JavaScript scripts to be executed on the server side, providing the ability to execute directly on the server or store function definitions for later invocation.
-
Multi-language support: MongoDB provides support for multiple programming languages, including but not limited to RUBY, PYTHON, JAVA, C++, PHP, and C#.
-
Easy installation: MongoDB's installation process is simple and intuitive, making it easy for users to quickly deploy and use.
History
| Version | Release date | Feature description |
|---|---|---|
| 1.0 | August 2009 | More indexes per collection Faster index creation |
| 1.2 | December 2009 | Map/Reduce Stored JavaScript functions Configurable fsync time Several minor features and fixes |
| 1.4 | March 2010 | Production-ready sharding |
| 1.6 | August 2010 | Replica sets IPv6 support |
| 1.8 | March 2011 | |
| 2.0 | September 2011 | |
| 2.2 | August 2012 | Enhanced geospatial support Switch to V8 JavaScript engine |
| 2.4 | March 2013 | Security enhancements Text search (beta) Hash indexes Aggregation enhancements Text search integration |
| 2.6 | April 8, 2014 | Query engine improvements New write operation protocol Security enhancements WiredTiger storage engine support Pluggable storage engine API |
| 3.0 | March 3, 2015 | SCRAM-SHA-1 authentication Improved explain feature MongoDB Ops Manager Replica set election enhancements WiredTiger storage engine default |
| 3.2 | December 8, 2015 | Config servers as replica sets Read concern Switch from V8 to SpiderMonkey Linearizable read concern |
| 3.4 | November 29, 2016 | Views Collation |
| 3.6 | November 2017 | |
| 4.0 | June 2018 | Transactions |
| 4.2 | August 2019 | |
| 4.4 | July 2020 | |
| 4.4.5 | April 2021 | |
| 4.4.6 | May 2021 | Future-oriented versioned API |
| 5.0 | July 13, 2021 | Client-side field-level encryption Live resharding Time series support |
| 6.0 | July 2022 | |
| 7.0 | August 15, 2023 |
MongoDB Download
You can download the installation package from the MongoDB official website at:https://www.mongodb.com/try/download/community。
MongoDB supports the following platforms:
Linux: MongoDB supports various Linux distributions, including but not limited to Ubuntu, Debian, CentOS, Red Hat Enterprise Linux (RHEL), Fedora, etc.
Windows: MongoDB provides an official version for the Windows operating system, which can run on Windows Server and Windows desktop operating systems.
macOS: MongoDB can run on macOS and provides an official installer for macOS.
Docker: MongoDB can also run as a Docker container, making it more convenient to deploy and manage MongoDB on various platforms.

Language Support
MongoDB has official drivers as follows:
MongoDB Tools
There are several management tools available for MongoDB.
Monitoring
MongoDB provides the network and system monitoring tool Munin, which is applied as a plugin in MongoDB.
Gangila is a high-performance system monitoring tool for MongoDB, which is applied as a plugin in MongoDB.
Cacti is an open-source GUI-based tool for viewing CPU load and network bandwidth utilization; it also provides a plugin for monitoring MongoDB.
GUI
- Fang of Mongo – web-based, built with Django and jQuery.
- Futon4Mongo – a MongoDB clone of CouchDB's Futon web.
- Mongo3 – written in Ruby.
- MongoHub – an application for OSX.
- Opricot – a browser-based MongoDB console, written in PHP.
- Database Master — a MongoDB management tool for Windows
- RockMongo — the best PHP-language MongoDB management tool, lightweight, and supports multiple languages.
MongoDB Use Cases
The following lists some actual applications of MongoDB by companies:
- Craigslist uses MongoDB to archive billions of records.
- FourSquare, a location-based social networking site, uses MongoDB on Amazon EC2 servers to share data.
- Shutterfly, an internet-based social and personal publishing service, uses MongoDB for various persistent data storage requirements.
- bit.ly, a web-based URL shortening service, uses MongoDB to store its own data.
- spike.com, an affiliate company of MTV Networks, uses MongoDB.
- Intuit, a software and service provider for small businesses and individuals, uses MongoDB to track user data for small businesses.
- sourceforge.net, a resource website for finding, creating, and publishing open source software for free, uses MongoDB for backend storage.
- etsy.com, a website for buying and selling handmade items, uses MongoDB.
- The New York Times, one of the leading online news portals, uses MongoDB.
- CERN, the renowned particle physics research institute, uses MongoDB for data from the Large Hadron Collider.