Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

MongoDB

Page semi-protected
From Wikipedia, the free encyclopedia
Cross-platform document-oriented database

MongoDB
DeveloperMongoDB Inc.
Initial releaseFebruary 11, 2009; 17 years ago (2009-02-11)[1]
Stable release
8.2.3[2] Edit this on Wikidata / 22 December 2025, 58 days ago
Written inC++,JavaScript,Python,C
Operating systemWindows 10 and later,Linux,OS X 10.7 and later,Solaris,[3]FreeBSD[4]
Available inEnglish
TypeDocument-oriented database
LicenseServer Side Public License orproprietary
Websitemongodb.com
Repository

MongoDB is asource-available,cross-platform,document-oriented database program. Classified as aNoSQL database product, MongoDB usesJSON-like documents (called BSON) with optionalschemas. Released in February 2009 by10gen (nowMongoDB Inc.), it supports features likesharding,replication, andACID transactions (from version 4.0). MongoDB Atlas, its managed cloud service, operates onAWS,Google Cloud Platform, andMicrosoft Azure. Current versions are licensed under theServer Side Public License (SSPL). MongoDB is a member of theMACH Alliance.

History

See also:MongoDB Inc. § History

The American software company 10gen began developing MongoDB in 2007 as a component of a plannedplatform-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.[5]

On October 20, 2017, MongoDB became a publicly traded company, listed on NASDAQ as MDB with an IPO price of $24 per share.[6]

On November 8, 2018, with the stable release 4.0.4, the software's license changed from AGPL 3.0 to SSPL.[7][8]

On October 30, 2019, MongoDB teamed withAlibaba Cloud to offer Alibaba Cloud customers a MongoDB-as-a-service solution. Customers can use the managed offering from Alibaba's global data centers.[9]

In December 2025, a major exploit was discovered and titled as "MongoBleed". This exploit led to the compromising of many corporate servers.[10][11]

Background

As of May 2025, MongoDB was the fifth most popular database software.[12][13] It focuses mostly on managing large databases of unstructured, "messy" data.[14][15] It's typically used for mobile and web apps that commonly use unstructured databases.[16] As of 2024, there were 50,000 MongoDB customers.[16] MongoDB was originally best known as a NoSQL database product.[17] The company released a database as-a-service product called Atlas in 2016[18] that became 70 percent of MongoDB's revenue by 2024.[16] Over time, MongoDB added analytics, transactional databases,[19] encryption,[20]vector databases,[16]ACID, migration features, and other enterprise tools.[21] Initially, the MongoDB software was free and open source[18] under theAGPL license. MongoDB adopted anSSPL (server side public license) for future releases starting in 2018.[16][22]

Main features

icon
This sectionneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources in this section. Unsourced material may be challenged and removed.
Find sources: "MongoDB" – news ·newspapers ·books ·scholar ·JSTOR
(October 2025) (Learn how and when to remove this message)

Ad-hoc queries

MongoDB supports field,range query andregular-expression searches.[23] Queries can return specific fields of documents and also include user-definedJavaScript 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.[24] 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 onlyeventually consistent by default.

If the replicated MongoDB deployment only has a single secondary member, a separatedaemon called an arbiter must be added to the set. It has the single responsibility of resolving the election of the new primary.[25] 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.[25]

Load balancing

MongoDB scales horizontally usingsharding.[26] 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 afile system, calledGridFS, with load-balancing and data-replication features over multiple machines for storing files.

This function, called agrid file system,[27] 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 forNginx[28] andlighttpd.[29] GridFS divides a file into parts, or chunks, and stores each of those chunks as a separate document.[30]

Aggregation

MongoDB provides three ways to perform aggregation: the aggregation pipeline (preferred), themap-reduce function (deprecated as of MongoDB 5.0) and single-purpose aggregation methods.[31]

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.[32]

The aggregation framework enables users to obtain results similar to those returned by queries that include theSQL GROUP BY clause. Aggregation operators can be strung together to form a pipeline, analogous toUnix pipes. The aggregation framework includes the $lookup operator, which can join documents from multiple collections, as well as statistical operators such as standard deviation.

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 acircular queue.

Transactions

MongoDB supports multi-documentACID transactions since the 4.0 release in June 2018.[33]

Licensing

As of October 2018, MongoDB is released under theServer Side Public License (SSPL), a non-free license developed by the project. It replaces theGNU Affero General Public License. In contrast to the AGPL, the SSPL prevents anyone but MongoDB Inc. from making MongoDB "available as a service" without negotiating a separate license from MongoDb Inc. The license text specifies a condition for making MongoDB which MongoDB Inc. has claimed to be similar to AGPL, but is actually impossible to comply with. The condition states that "all programs that you use to make the Program" ... "available as a service" must be published under the SSPL. However, a core component of MongoDB called WiredTiger is licensed as GPL, and the GPL does not allow redistribution under any license except the GPL. This does not apply to the copyright holder (MongoDB Inc.). Since MongoDB's SSPL adoption in 2018, no one has ever provided MongoDB as a paid service under the SSPL license (including MongoDB Inc.).

[34][35] The SSPL was submitted for certification to theOpen Source Initiative but later withdrawn.[36] In January 2021, the Open Source Initiative stated that SSPL is not an open source license.[37] The language drivers are available under anApache License. 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.[38]

MongoDB has been removed from theDebian,Fedora andRed Hat Enterprise Linux distributions because of the licensing change. Fedora determined that the SSPL version 1 is not afree software license because it is "intentionally crafted to be aggressively discriminatory" towards commercial users.[39][40]

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 beenheld for ransom.[41][42] In September 2017, Davi Ottenheimer head of product security at MongoDB, proclaimed that measures had been taken to defend against these risks.[43]

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.[44] The issue was addressed in version 3.4.0, released in November 2016,[45] and applied to earlier releases from v3.2.12 onward.[46]

Before version 2.2,locks were implemented on a per-server-process basis. With version 2.2, locks were implemented at the database level.[47] Beginning with version 3.0,[48] pluggable storage engines are available, and each storage engine may implement locks differently.[48] With MongoDB 3.0, locks are implemented at the collection level for the MMAPv1 storage engine,[49] while theWiredTiger storage engine uses an optimistic concurrency protocol that effectively provides document-level locking.[50] Even with versions prior to 3.0, one approach to increase concurrency is to usesharding.[51] 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.[52]

Until version 3.3.11, MongoDB could not performcollation-based sorting and was limited to bytewise comparison viamemcmp, which would not provide correct ordering for many non-English languages when used with aUnicode 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.[53] The introduction of the snapshot read concern in MongoDB 4.0 eliminated this risk.[54]

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."[55] Jepsen, which describes itself as a "distributed systems safety research company," disputed both claims onTwitter, 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.[56] 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.[57]

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."[57] 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."[58]

See also

References

  1. ^"State of MongoDB March, 2010".DB-Engines.Archived from the original on September 18, 2017. RetrievedJuly 5, 2017.
  2. ^"Release 8.2.3". December 22, 2025. RetrievedDecember 26, 2025.
  3. ^"How to Set Up a MongoDB NoSQL Cluster Using Oracle Solaris Zones".Oracle.Archived from the original on August 12, 2017. RetrievedJuly 5, 2017.
  4. ^"How-To: MongoDB on FreeBSD 10.x".FreeBSD News.Archived from the original on December 28, 2017. RetrievedJuly 5, 2017.
  5. ^"10gen embraces what it created, becomes MongoDB Inc".Gigaom. Archived fromthe original on March 5, 2016. RetrievedJanuary 29, 2016.
  6. ^Witkowski, Wallace (October 21, 2017)."MongoDB shares rally 34% in first day of trading above elevated IPO price".MarketWatch. Dow Jones.Archived from the original on February 26, 2018. RetrievedFebruary 26, 2018.
  7. ^"4.0 Changelog – 4.0.4 Changelog – Build and Packaging". RetrievedJune 28, 2023.
  8. ^"Release Notes for MongoDB 4.0 – 4.0.4 – Nov 8, 2018". RetrievedJune 28, 2023.
  9. ^Betz, Brandy (October 30, 2019)."MongoDB teams with Alibaba Cloud".Seeking Alpha. RetrievedOctober 31, 2019.
  10. ^Canada, Communications Security Establishment (December 24, 2025)."MongoDB security advisory (AV25-862)".Canadian Centre for Cyber Security. RetrievedDecember 28, 2025.
  11. ^"CVE-2025-14847".
  12. ^Kanaracus, Chris (January 11, 2019)."AWS, MongoDB database collision stirs open source tensions".SearchAWS. RetrievedAugust 10, 2024.
  13. ^"DB-Engines Ranking".DB-Engines. January 1, 2024. RetrievedAugust 27, 2024.
  14. ^Bort, Julie (October 20, 2017)."People told the MongoDB founders they were 'completely crazy' and now the company is worth $1.6 billion".Business Insider. RetrievedAugust 9, 2024.
  15. ^Joseph, Lison (December 3, 2013)."MongoDB startup hired by Aadhaar got funds from CIA VC arm".The Economic Times. RetrievedAugust 9, 2024.
  16. ^abcdeSawers, Paul (April 28, 2024)."MongoDB CEO Dev Ittycheria talks AI hype and the database evolution as he crosses 10-year mark".TechCrunch. RetrievedAugust 11, 2024.
  17. ^Lardinois, Frederic (March 7, 2017)."MongoDB's Atlas database service goes freemium".TechCrunch. RetrievedAugust 10, 2024.
  18. ^abSawers, Paul (October 10, 2018)."MongoDB to acquire cloud database provider MLab for $68 million".VentureBeat. RetrievedAugust 10, 2024.
  19. ^Baer, Tony (June 21, 2022)."Are Snowflake and MongoDB on a collision course?".VentureBeat. RetrievedAugust 11, 2024.
  20. ^Newman, Lily Hay (June 7, 2022)."A Long-Awaited Defense Against Data Leaks May Have Just Arrived".Wired. RetrievedAugust 11, 2024.
  21. ^Brust, Andrew (June 7, 2022)."MongoDB fires up new cloud, on-premises releases".VentureBeat. RetrievedAugust 11, 2024.
  22. ^Lardinois, Frederic (October 16, 2018)."MongoDB switches up its open-source license".TechCrunch. RetrievedAugust 10, 2024.
  23. ^Davis Kerby."Why MongoDB is the way to go". DZone.Archived from the original on June 12, 2018. RetrievedJuly 6, 2017.
  24. ^"Ridiculously fast MongoDB replica recovery Part 1 of 2". ClusterHQ. Archived from the original on October 30, 2017.
  25. ^ab"MongoDB docs – Replica Set Arbiter". RetrievedApril 9, 2021.
  26. ^"Turning MongoDB Replica Set to a Sharded Cluster".Severalnines. May 11, 2013.Archived from the original on November 25, 2016.
  27. ^"GridFS & MongoDB: Pros & Cons".Compose. June 5, 2014.Archived from the original on September 10, 2017.
  28. ^"NGINX plugin for MongoDB source code".GitHub.Archived from the original on April 11, 2016. RetrievedSeptember 10, 2016.
  29. ^"lighttpd plugin for MongoDB source code".Bitbucket.Archived from the original on August 7, 2011. RetrievedJune 28, 2010.
  30. ^Malick Md."MongoDB overview".Expertstown. Archived from the original on March 5, 2014. RetrievedFebruary 27, 2014.
  31. ^"Aggregation — MongoDB Manual".docs.mongodb.com.Archived from the original on November 29, 2018. RetrievedAugust 14, 2018.
  32. ^"Map-Reduce — MongoDB Manual".docs.mongodb.com.Archived from the original on August 14, 2018. RetrievedAugust 14, 2018.
  33. ^"MongoDB Drives NoSQL More Deeply into Enterprise Opportunities". June 27, 2018.Archived from the original on August 7, 2018. RetrievedAugust 7, 2018.
  34. ^Baer, Tony."It's MongoDB's turn to change its open source license".ZDNet.Archived from the original on October 31, 2018. RetrievedOctober 16, 2018.
  35. ^"MongoDB switches up its open source license".TechCrunch.Archived from the original on October 16, 2018. RetrievedOctober 16, 2018.
  36. ^Staff, Ars (October 16, 2019)."In 2019, multiple open source companies changed course—is it the right move?".Ars Technica.
  37. ^OSI (January 19, 2021)."The SSPL is Not an Open Source License".OSI. Archived fromthe original on August 20, 2022. RetrievedAugust 20, 2022.
  38. ^"GitHub – mongodb/mongo at r4.0.3".GitHub. RetrievedJanuary 18, 2024.
  39. ^Vaughan-Nichols, Steven J."MongoDB "open-source" Server Side Public License rejected".ZDNet.Archived from the original on January 16, 2019. RetrievedJanuary 17, 2019.
  40. ^"MongoDB's licensing changes led Red Hat to drop the database from the latest version of its server OS".GeekWire. January 16, 2019.Archived from the original on January 17, 2019. RetrievedJanuary 17, 2019.
  41. ^Krebs, Brian."Extortionists Wipe Thousands of Databases, Victims Who Pay Up Get Stiffed".krebsonsecurity.com. Brian Krebs.Archived from the original on January 11, 2017. RetrievedJanuary 11, 2017.
  42. ^Constantin, Lucian (January 6, 2017)."Ransomware groups have deleted over 10,000 MongoDB databases".Computer World. IDG.Archived from the original on January 10, 2017. RetrievedJanuary 11, 2017.
  43. ^Ottenheimer, Davi."How to Avoid a Malicious Attack That Ransoms Your Data".www.mongodb.com. RetrievedJune 22, 2021.
  44. ^Kyle Kingsbury (April 20, 2015)."Call me maybe: MongoDB stale reads".Archived from the original on August 15, 2015. RetrievedJuly 4, 2015.
  45. ^"Release Notes for MongoDB 3.4".MongoDB Manual.Archived from the original on August 14, 2018. RetrievedApril 6, 2018.
  46. ^Kingsbury, Kyle (February 7, 2017)."MongoDB 3.4.0-rc3".Jepsen.Archived from the original on October 23, 2017.
  47. ^"Atomicity, isolation & concurrency in MongoDB".scalegrid.io.Archived from the original on September 10, 2017. RetrievedJune 28, 2017.
  48. ^ab"MongoDB Goes Pluggable with Storage Engines". datanami.com. March 5, 2015.Archived from the original on July 4, 2017. RetrievedJune 28, 2017.
  49. ^Arborian Consulting."MongoDB, MMAPv1, WiredTiger, Locking, and Queues". Arborian Consulting.Archived from the original on June 19, 2017. RetrievedJune 28, 2017.
  50. ^Kenny Gorman (October 2015)."MongoDB 3.0 WiredTiger Compression and Performance". Objectrocket.com/.Archived from the original on June 16, 2017. RetrievedJune 28, 2017.
  51. ^Mikita Manko."MongoDB performance bottlenecks, optimization Strategies for MongoDB". mikitamanko.com. Archived from the original on July 19, 2017. RetrievedJuly 5, 2017.
  52. ^scalegrid.io (September 12, 2013)."Atomicity, isolation & concurrency in MongoDB". scalegrid.io.Archived from the original on September 10, 2017. RetrievedJuly 5, 2017.
  53. ^Glasser, David (June 7, 2016)."MongoDB queries don't always return all matching documents!".Meteor Blog.
  54. ^"MongoDB Docs".Archived from the original on March 6, 2019. RetrievedMarch 5, 2019.
  55. ^"MongoDB and Jepsen".MongoDB. Archived fromthe original on May 8, 2020. RetrievedAugust 4, 2023.
  56. ^Allen, Jonathan (May 22, 2020)."Jepsen Disputes MongoDB's Data Consistency Claims".InfoQ.Archived from the original on June 6, 2023. RetrievedAugust 4, 2023.
  57. ^abKingsbury, Kyle (May 15, 2020)."Jepsen: MongoDB 4.2.6".Jepsen.Archived from the original on May 29, 2023. RetrievedAugust 4, 2023.
  58. ^"MongoDB And Jepsen".MongoDB.Archived from the original on June 10, 2023. RetrievedAugust 4, 2023.

Bibliography

External links

MongoDB at Wikipedia'ssister projects
Platform
Packaging
Frameworks
Libraries
Languages
International
National
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=MongoDB&oldid=1337270177"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp