MongoDB is a
source-available
Source-available software is software released through a source code distribution model that includes arrangements where the source can be viewed, and in some cases modified, but without necessarily meeting the criteria to be called ''open-source ...
,
cross-platform
Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several Computing platform, computing platforms. Some ...
,
document-oriented database
A document-oriented database, or document store, is a computer program and data storage system designed for storing, retrieving and managing document-oriented information, also known as semi-structured data.
Document-oriented databases are one ...
program. Classified as a
NoSQL
NoSQL (originally meaning "Not only SQL" or "non-relational") refers to a type of database design that stores and retrieves data differently from the traditional table-based structure of relational databases. Unlike relational databases, which ...
database product, MongoDB uses
JSON
JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
-like documents with optional
schemas. Released in February 2009 by
10gen (now
MongoDB Inc.), it supports features like
sharding
A database shard, or simply a shard, is a horizontal partition of data in a database or search engine. Each shard may be held on a separate database server instance, to spread load.
Some data in a database remains present in all shards, but so ...
,
replication, and
ACID
An acid is a molecule or ion capable of either donating a proton (i.e. Hydron, hydrogen cation, H+), known as a Brønsted–Lowry acid–base theory, Brønsted–Lowry acid, or forming a covalent bond with an electron pair, known as a Lewis ...
transactions (from version 4.0). MongoDB Atlas, its managed cloud service, operates on
AWS,
Google Cloud Platform
Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google that provides a series of modular cloud services including computing, Computer data storage, data storage, Data analysis, data analytics, and machine learnin ...
, and
Microsoft Azure
Microsoft Azure, or just Azure ( /ˈæʒər, ˈeɪʒər/ ''AZH-ər, AY-zhər'', UK also /ˈæzjʊər, ˈeɪzjʊər/ ''AZ-ure, AY-zure''), is the cloud computing platform developed by Microsoft. It has management, access and development of ...
. Current versions are licensed under the
Server Side Public License
The Server Side Public License (SSPL) is a Source-available software, source-available copyleft software license introduced by MongoDB Inc. in 2018.
It includes most of the text and provisions of the GNU Affero General Public License version ...
(SSPL). MongoDB is a member of the
MACH Alliance.
History
The American software company 10gen began developing MongoDB in 2007 as a component of a planned
platform-as-a-service product. In 2009, the company shifted to an open-source development model and began offering commercial support and other services. In 2013, 10gen changed its name to MongoDB Inc.
On October 20, 2017, MongoDB became a publicly traded company, listed on NASDAQ as MDB with an IPO price of $24 per share.
On November 8, 2018, with the stable release 4.0.4, the software's license changed from AGPL 3.0 to SSPL.
On October 30, 2019, MongoDB teamed with
Alibaba Cloud
Alibaba Cloud, also known as Aliyun ( zh, p=Ālǐyún, s=阿里云, l=Ali Cloud), is a cloud computing company, a subsidiary of Alibaba Group. Alibaba Cloud provides cloud computing services to online businesses and Alibaba's own e-commerce ecos ...
to offer Alibaba Cloud customers a MongoDB-as-a-service solution. Customers can use the managed offering from Alibaba's global data centers.
Background
As of May 2025, MongoDB was the fifth most popular database software.
It focuses mostly on managing large databases of unstructured, "messy" data.
It's typically used for mobile and web apps that commonly use unstructured databases.
As of 2024, there were 50,000 MongoDB customers.
MongoDB was originally best known as a NoSQL database product.
The company released a database as-a-service product called Atlas in 2016
that became 70 percent of MongoDB's revenue by 2024.
Over time, MongoDB added analytics, transactional databases,
encryption,
vector database
A vector database, vector store or vector search engine is a database that uses the vector space model to store vectors (fixed-length lists of numbers) along with other data items. Vector databases typically implement one or more Nearest neighbor ...
s,
ACID
An acid is a molecule or ion capable of either donating a proton (i.e. Hydron, hydrogen cation, H+), known as a Brønsted–Lowry acid–base theory, Brønsted–Lowry acid, or forming a covalent bond with an electron pair, known as a Lewis ...
, migration features, and other enterprise tools.
Initially, the MongoDB software was free and open source
under the
AGPL license. MongoDB adopted an
SSPL (server side public license) for future releases starting in 2018.
MongoDB release history
Main features
Ad-hoc queries
MongoDB supports field,
range query and
regular-expression searches.
Queries can return specific fields of documents and also include user-defined
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
functions. Queries can also be configured to return a random sample of results of a given size.
Indexing
Fields in a MongoDB document can be indexed with primary and secondary indices.
Replication
MongoDB provides high availability with replica sets. A replica set consists of two or more copies of the data. Each replica-set member may act in the role of primary or secondary replica at any time. All writes and reads are done on the primary replica by default. Secondary replicas maintain a copy of the data of the primary using built-in replication. When a primary replica fails, the replica set automatically conducts an election process to determine which secondary should become the primary. Secondaries can optionally serve read operations, but that data is only
eventually consistent by default.
If the replicated MongoDB deployment only has a single secondary member, a separate
daemon
A demon is a malevolent supernatural being, evil spirit or fiend in religion, occultism, literature, fiction, mythology and folklore.
Demon, daemon or dæmon may also refer to:
Entertainment Fictional entities
* Daemon (G.I. Joe), a character ...
called an arbiter must be added to the set. It has the single responsibility of resolving the election of the new primary.
As a consequence, an ideal distributed MongoDB deployment requires at least three separate servers, even in the case of just one primary and one secondary.
Load balancing
MongoDB scales horizontally using
sharding
A database shard, or simply a shard, is a horizontal partition of data in a database or search engine. Each shard may be held on a separate database server instance, to spread load.
Some data in a database remains present in all shards, but so ...
. The user chooses a shard key, which determines how the data in a collection will be distributed. The data is split into ranges (based on the shard key) and distributed across multiple shards, which are masters with one or more replicas. Alternatively, the shard key can be hashed to map to a shard – enabling an even data distribution.
MongoDB can run over multiple servers,
balancing the load or duplicating data to keep the system functional in case of hardware failure.
File storage
MongoDB can be used as a
file system, called
GridFS, with load-balancing and data-replication features over multiple machines for storing files.
This function, called a
grid file system, is included with MongoDB drivers. MongoDB exposes functions for file manipulation and content to developers. GridFS can be accessed using the mongofiles utility or plugins for
Nginx
(pronounced "engine x" , stylized as NGINX or nginx) is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Russian developer Igor Sysoev and publicly released in 20 ...
and
lighttpd
lighttpd (prescribed pronunciation: "lighty") is an open-source web server optimized for speed-critical environments while remaining standards-compliant, secure and flexible. It was originally written by Jan Kneschke as a proof-of-concept of the ...
. GridFS divides a file into parts, or chunks, and stores each of those chunks as a separate document.
Aggregation
MongoDB provides three ways to perform aggregation: the aggregation pipeline, the map-reduce function and single-purpose aggregation methods.
Map-reduce can be used for batch processing of data and aggregation operations. However, according to MongoDB's documentation, the aggregation pipeline provides better performance for most aggregation operations.
The aggregation framework enables users to obtain results similar to those returned by queries that include the
SQL
Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel")
is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
GROUP BY clause. Aggregation operators can be strung together to form a pipeline, analogous to
Unix pipes
In Unix-like computer operating systems, a pipeline is a mechanism for inter-process communication using message passing. A pipeline is a set of processes chained together by their standard streams, so that the output text of each process (''stdo ...
. The aggregation framework includes the $lookup operator, which can join documents from multiple collections, as well as statistical operators such as standard deviation.
Server-side JavaScript execution
JavaScript can be used in queries, aggregation functions (such as
MapReduce
MapReduce is a programming model and an associated implementation for processing and generating big data sets with a parallel and distributed algorithm on a cluster.
A MapReduce program is composed of a ''map'' procedure, which performs filte ...
) and sent directly to the database to be executed.
Capped collections
MongoDB supports fixed-size collections called capped collections. This type of collection maintains insertion order and, once the specified size has been reached, behaves like a
circular queue
In computer science, a circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer (computer science), buffer as if it were connected end-to-end. This structure lends itself easily to bu ...
.
Transactions
MongoDB supports multi-document
ACID
An acid is a molecule or ion capable of either donating a proton (i.e. Hydron, hydrogen cation, H+), known as a Brønsted–Lowry acid–base theory, Brønsted–Lowry acid, or forming a covalent bond with an electron pair, known as a Lewis ...
transactions since the 4.0 release in June 2018.
Editions
MongoDB Community Server
The MongoDB Community Edition is free and available for Windows, Linux and macOS.
MongoDB Enterprise Server
MongoDB Enterprise Server is the commercial edition of MongoDB and is available as part of the MongoDB Enterprise Advanced subscription.
MongoDB Atlas
MongoDB is also available as an on-demand, fully managed service. MongoDB Atlas runs on AWS, Microsoft Azure and Google Cloud Platform.
On March 10, 2022, MongoDB warned its users in Russia and
Belarus
Belarus, officially the Republic of Belarus, is a landlocked country in Eastern Europe. It is bordered by Russia to the east and northeast, Ukraine to the south, Poland to the west, and Lithuania and Latvia to the northwest. Belarus spans an a ...
that their data stored on the MongoDB Atlas platform will be destroyed as a result of American sanctions related to the
Russo-Ukrainian War
The Russo-Ukrainian War began in February 2014 and is ongoing. Following Ukraine's Revolution of Dignity, Russia Russian occupation of Crimea, occupied and Annexation of Crimea by the Russian Federation, annexed Crimea from Ukraine. It then ...
.
Architecture
Programming language accessibility
MongoDB has official drivers for major programming languages and development environments.
There are also a large number of unofficial or community-supported drivers for other programming languages and frameworks.
Serverless access
Management and graphical front-ends

The primary interface to the database has been the mongo shell. Since MongoDB 3.2, MongoDB Compass is introduced as the native GUI. There are products and third-party projects that offer user interfaces for administration and data viewing.
Licensing
MongoDB Community Server
As of October 2018, MongoDB is released under the
Server Side Public License
The Server Side Public License (SSPL) is a Source-available software, source-available copyleft software license introduced by MongoDB Inc. in 2018.
It includes most of the text and provisions of the GNU Affero General Public License version ...
(SSPL), a non-free license developed by the project. It replaces the
GNU Affero General Public License
The GNU Affero General Public License (GNU AGPL) is a free, copyleft license published by the Free Software Foundation in November 2007, and based on the GNU GPL version 3 and the ''Affero General Public License'' (non-GNU).
It is intended fo ...
, and is nearly identical to the
GNU General Public License version 3, but requires that those making the software publicly available as part of a "service" must make the service's entire
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
(insofar that a user would be able to recreate the service themselves) available under this license. By contrast, the AGPL only requires the source code of the licensed software to be provided to users when the software is conveyed over a network. The SSPL was submitted for certification to the
Open Source Initiative
The Open Source Initiative (OSI) is a California public benefit corporation "actively involved in Open Source community-building, education, and public advocacy to promote awareness and the importance of non-proprietary software".
Governance
The ...
but later withdrawn. In January 2021, the Open Source Initiative stated that SSPL is not an open source license. The language drivers are available under an
Apache License
The Apache License is a permissive free software license written by the Apache Software Foundation (ASF). It allows users to use the software for any purpose, to distribute it, to modify it, and to distribute modified versions of the software ...
. In addition, MongoDB Inc. offers proprietary licenses for MongoDB. The last versions licensed as AGPL version 3 are 4.0.3 (stable) and 4.1.4.
MongoDB has been removed from the
Debian
Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
,
Fedora
A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
and
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a commercial Linux distribution developed by Red Hat. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop version for x86-64. Fedora Linux and ...
distributions because of the licensing change. Fedora determined that the SSPL version 1 is not a
free software
Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
license because it is "intentionally crafted to be aggressively discriminatory" towards commercial users.
Bug reports and criticisms
Security
Because of MongoDB's default security configuration, which allows any user full access to the database, data from tens of thousands of MongoDB installations has been stolen. Furthermore, many MongoDB servers have been
held for ransom. In September 2017, Davi Ottenheimer head of product security at MongoDB, proclaimed that measures had been taken to defend against these risks.
From the MongoDB 2.6 release onward, the binaries for the official MongoDB RPM and DEB packages bind to
localhost
In computer networking, localhost is a hostname that refers to the current computer used to access it. The name ''localhost'' is reserved for loopback purposes.
It is used to access the network services that are running on the host via t ...
by default. From MongoDB 3.6, this default behavior was extended to all MongoDB packages across all platforms. As a result, all networked connections to the database are denied unless explicitly configured by an administrator.
Technical criticisms
In some failure scenarios in which an application can access two distinct MongoDB processes that cannot access each other, it is possible for MongoDB to return stale reads. It is also possible for MongoDB to roll back writes that have been acknowledged. The issue was addressed in version 3.4.0, released in November 2016, and applied to earlier releases from v3.2.12 onward.
Before version 2.2,
locks were implemented on a per-server-process basis. With version 2.2, locks were implemented at the database level. Beginning with version 3.0,
pluggable storage engines are available, and each storage engine may implement locks differently.
With MongoDB 3.0, locks are implemented at the collection level for the MMAPv1 storage engine, while the
WiredTiger
WiredTiger is a NoSQL, open source extensible platform for data management. It is released under version 2 or 3 of the GNU General Public License. WiredTiger uses multiversion concurrency control (MVCC) architecture.
Details
MongoDB acquired Wired ...
storage engine uses an optimistic concurrency protocol that effectively provides document-level locking. Even with versions prior to 3.0, one approach to increase concurrency is to use
sharding
A database shard, or simply a shard, is a horizontal partition of data in a database or search engine. Each shard may be held on a separate database server instance, to spread load.
Some data in a database remains present in all shards, but so ...
. In some situations, reads and writes will yield their locks. If MongoDB predicts that a page is unlikely to be in memory, operations will yield their lock while the pages load. The use of lock yielding expanded greatly in version 2.2.
Until version 3.3.11, MongoDB could not perform
collation
Collation is the assembly of written information into a standard order. Many systems of collation are based on numerical order or alphabetical order, or extensions and combinations thereof. Collation is a fundamental element of most office fi ...
-based sorting and was limited to bytewise comparison via
memcmp, which would not provide correct ordering for many non-English languages when used with a
Unicode
Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
encoding. The issue was fixed on August 23, 2016.
Prior to MongoDB 4.0, queries against an index were not atomic. Documents that were updated while queries was running could be missed. The introduction of the snapshot read concern in MongoDB 4.0 eliminated this risk.
MongoDB claimed that version 3.6.4 had passed "the industry's toughest data safety, correctness, and consistency tests" by Jepsen, and that "MongoDB offers among the strongest data consistency, correctness, and safety guarantees of any database available today."
Jepsen, which describes itself as a "distributed systems safety research company," disputed both claims on
Twitter
Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
, saying, "In that report, MongoDB lost data and violated causal by default." In its May 2020 report on MongoDB version 4.2.6, Jepsen wrote that MongoDB had only mentioned tests that version 3.6.4 had passed, and that version had 4.2.6 introduced more problems.
Jepsen's test summary reads in part:
Jepsen evaluated MongoDB version 4.2.6, and found that even at the strongest levels of read and write concern, it failed to preserve snapshot isolation. Instead, Jepsen observed read skew, cyclic information flow, duplicate writes, and internal consistency violations. Weak defaults meant that transactions could lose writes and allow dirty reads, even downgrading requested safety levels at the database and collection level. Moreover, the snapshot read concern did not guarantee snapshot unless paired with write concern majority—even for read-only transactions. These design choices complicate the safe use of MongoDB transactions.
On May 26, Jepsen updated the report to say: "MongoDB identified a bug in the transaction retry mechanism which they believe was responsible for the anomalies observed in this report; a patch is scheduled for 4.2.8."
The issue has been patched as of that version, and "Jepsen criticisms of the default write concerns have also been addressed, with the default write concern now elevated to the majority concern (w:majority) from MongoDB 5.0."
MongoDB conference
MongoDB Inc. hosts an annual developer conference that has been called MongoDB World or MongoDB.live.
See also
*
Couchbase
*
Apache Cassandra
Apache Cassandra is a free and open-source software, free and open-source database management system designed to handle large volumes of data across multiple Commodity computing, commodity servers. The system prioritizes availability and scalab ...
*
BSON
BSON (; Binary JSON) is a computer data interchange format extending JSON. It is a binary form for representing simple or complex data structures including associative arrays (also known as name-value pairs), integer indexed arrays, and a suit ...
, the binary
JSON
JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
format that MongoDB uses for data storage and transfer
*
List of server-side JavaScript implementations
*
MEAN
A mean is a quantity representing the "center" of a collection of numbers and is intermediate to the extreme values of the set of numbers. There are several kinds of means (or "measures of central tendency") in mathematics, especially in statist ...
, a
solutions stack
In computing, a solution stack or software stack is a set of software subsystems or components needed to create a complete Computing platform, platform such that no additional software is needed to support applications. Applications are said to " ...
using MongoDB as the database
*
Server-side scripting
Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of s ...
*
Amazon DocumentDB, a proprietary database service designed for MongoDB compatibility
*
Azure Cosmos DB, a proprietary database service suite designed for multi-database compatibility including MongoDB
References
Bibliography
*
*
*
*
External links
*
{{Authority control
2009 software
Database-related software for Linux
Distributed computing architecture
Document-oriented databases
NoSQL
Structured storage
Software using the Server Side Public License
Open source projects