MongoDB

维基百科,自由的百科全书
跳转到导航 跳转到搜索
MongoDB
File:MongoDB Logo.svg
開發者MongoDB Inc.英语MongoDB Inc.
首次发布2009年2月11日,​17年前​(2009-02-11[1]
当前版本
    Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
    源代码库
    • {{URL|example.com|可选的显示文本}}
    Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
    编程语言C++GoJavaScriptPython
    引擎
      Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
      操作系统Windows 10及以上、LinuxmacOS 10.7及以上、Solaris[2]FreeBSD[3]
      平台x86_64ARM64S390x英语S390x,企业版额外支持PPC64LE[4]
      语言英文
      类型面向文檔的數據庫
      许可协议服务器端公共许可证(SSPL)、商业许可证、语言驱动采用Apache许可证[5]

      MongoDB是一種面向文档数据库管理系统,用C++等语言撰寫而成,分類介于关系型数据库和非关系型数据库之间的NoSQL。MongoDB由MongoDB Inc.英语MongoDB Inc.(当时是10gen團隊)于2007年10月开发,2009年2月首度推出。2018年,MongoDB改成以服务器端公共许可证英语Server Side Public License分发,不再属于开源软件

      部署[编辑]

      MongoDB社区版是免费的,支援WindowsLinuxmacOS三種作業系統[6]。許多Linux套件管理系統曾经包含MongoDB的套件。2018年因许可证变更,MongoDB不再属于开源软件,DebianFedoraRed Hat Enterprise LinuxLinux发行版已從软件存储库中移除了MongoDB。[7][8]

      MongoDB使用内存映射文件,32位元系統上限制大小為2GB的資料,64位元支持更大的資料。[9] MongoDB的核心构件只能在小端序系統上运行,客户端库可以在小端序和大端序的系統上运行[10]

      語言支援[编辑]

      MongoDB有官方的驅動如下:C[11]、C++[12]、C#[13]、Erlang[14]、Haskell[15]、Java[16]、JavaScript[17]、Lisp[18]、fibjs[19]、node.JS[20]、Perl[21]、PHP[22]、Python[23]、Ruby[24]、Scala[25]、Go[26]和Rust[27]

      目前還有許多非官方的驅動,ColdFusion、[28] Delphi、[29] Erlang、[30][31] Factor、[32] Fantom、[33] Go、[34] JVM languages(Clojure、Groovy [35]、Scala等)、[36] Lua、[37] HTTP REST、[38] Racket[39]和Smalltalk[40]

      複製[编辑]

      MongoDB的開發人員可以保證一個操作已被複製到至少<math> N </math>個伺服器上每個運行的基礎。

      主從式[编辑]

      由於操作都是在主机,從機將複製任何更改的數據。

      例如:starting a master/slave pair locally:

      $ mkdir -p ~/dbs/master ~/dbs/slave
      $ ./mongod --master --port 10000 --dbpath ~/dbs/master
      $ ./mongod --slave --port 10001 --dbpath ~/dbs/slave --source localhost:10000
      

      副本集[编辑]

      副本集類似於主從式架構,但他們結合的能力為副機,如果當前一直遲緩時,選出新的主機。

      管理與圖形化介面[编辑]

      監視[编辑]

      支援MongoDB的監視插件:

      GUIs[编辑]

      目前較受歡迎的UI有:

      • Robo 3T(原Robomongo)[44] – 这是一个C++Qt写成的跨平台桌面程序。
      • Fang of Mongo[45] –這是一個網頁式的界面,由Django和jQuery所構成。
      • Futon4Mongo[46] – 一個以CouchDB Futon Web為介面的MongoDB克隆版本。
      • Mongo3[47] – Ruby寫成的介面。
      • MongoHub[48] –一個OS X應用程式。
      • Opricot[49] – 基於瀏覽器的MongoDB shell,由PHP撰寫而成。
      • Database Master MongoDB Tool for Windows
      • RockMongo Best PHP MongoDB Administrator轻量级,支持多国语言。
      • MongoVUE Download CS,图形界面,封装较好。
      • MongoDB Compass,MongoDB官方的跨平台GUI。

      安全漏洞[编辑]

      2025年12月曝出MongoDB Zlib压缩协议堆内存信息泄露漏洞(称为MongoBleed[50]CVE-2025-14847),攻击者可以在无需身份验证的情况下,从数据库服务器中提取未初始化的堆内存(Heap Memory)读取信息,影响2017年以来发布的所有版本[51]。该漏洞在12月24日修复[52]。虽然MongoDB称没有证据表明有人利用该漏洞[52],但是12月27日,游戏《彩虹六号:围攻》服务器遭到黑客入侵,被认为是黑客利用了该漏洞[53]

      著名用戶[编辑]

      參見[编辑]

      参考文献[编辑]

      1. ^ State of MongoDB March, 2010. DB-Engines英语DB-Engines ranking. [2018-05-04]. (原始内容存档于2017-09-18) (en-us). 
      2. ^ Install MongoDB. MongoDB Manual. [2018-09-19]. (原始内容存档于2020-12-02). 
      3. ^ How-To: MongoDB on FreeBSD 10.x. FreeBSD News. [2018-05-04]. (原始内容存档于2017-12-28). 
      4. ^ Production Notes - Supported Platforms. MongoDB Manual. [2018-09-19]. (原始内容存档于2020-12-03). 
      5. ^ MongoDB Licensing. mongodb.com. [2018-09-19]. (原始内容存档于2020-11-14). 
      6. ^ MongoDB Download Center. MongoDB. [August 14, 2018]. (原始内容存档于2018-08-14) (en-us). 
      7. ^ Vaughan-Nichols, Steven J. MongoDB "open-source" Server Side Public License rejected. ZDNet. [January 17, 2019]. (原始内容存档于2019-01-16) (English). 
      8. ^ MongoDB’s licensing changes led Red Hat to drop the database from the latest version of its server OS. GeekWire. January 16, 2019 [January 17, 2019]. (原始内容存档于2019-01-17) (en-US). 
      9. ^ 存档副本. [2011-06-23]. (原始内容存档于2009-09-12). 
      10. ^ Hardware Considerations. [2018-09-19]. (原始内容存档于2020-12-03). 
      11. ^ C页面存档备份,存于互联网档案馆
      12. ^ C++页面存档备份,存于互联网档案馆
      13. ^ C# / .NET页面存档备份,存于互联网档案馆
      14. ^ Erlang页面存档备份,存于互联网档案馆
      15. ^ Haskell页面存档备份,存于互联网档案馆
      16. ^ Java页面存档备份,存于互联网档案馆
      17. ^ JavaScript
      18. ^ Lisp页面存档备份,存于互联网档案馆
      19. ^ fibjs页面存档备份,存于互联网档案馆
      20. ^ node.JS页面存档备份,存于互联网档案馆
      21. ^ Perl页面存档备份,存于互联网档案馆
      22. ^ PHP页面存档备份,存于互联网档案馆
      23. ^ Python页面存档备份,存于互联网档案馆
      24. ^ Ruby页面存档备份,存于互联网档案馆
      25. ^ Scala页面存档备份,存于互联网档案馆
      26. ^ Go页面存档备份,存于互联网档案馆
      27. ^ MongoDB Rust Driver, mongodb, 2022-08-05 [2022-08-08], (原始内容存档于2022-08-08) 
      28. ^ ColdFusion driver. [2011-06-23]. (原始内容存档于2020-10-01). 
      29. ^ Delphi. [2011-06-23]. (原始内容存档于2016-08-14). 
      30. ^ Emongo Erlang driver. [2011-06-23]. (原始内容存档于2020-06-22). 
      31. ^ Erlmongo Erlang driver. [2011-06-23]. (原始内容存档于2010-04-22). 
      32. ^ Factor driver. [2011-06-23]. (原始内容存档于2016-04-19). 
      33. ^ Fantom driver. [2011-06-23]. (原始内容存档于2020-08-03). 
      34. ^ gomongo Go driver. [2011-06-23]. (原始内容存档于2020-11-09). 
      35. ^ GMongo. [2011-06-23]. (原始内容存档于2017-09-09). 
      36. ^ JVM language center. [2011-06-23]. (原始内容存档于2013-01-29). 
      37. ^ LuaMongo. [2011-06-23]. (原始内容存档于2016-01-18). 
      38. ^ REST interface. [2011-06-23]. (原始内容存档于2019-11-18). 
      39. ^ 存档副本. [2011-06-23]. (原始内容存档于2018-07-20). 
      40. ^ Smalltalk driver. [2011-06-23]. (原始内容存档于2019-10-18). 
      41. ^ Munin plugin. [2011-06-23]. (原始内容存档于2020-10-24). 
      42. ^ Ganglia plugin. [2011-06-23]. (原始内容存档于2020-09-16). 
      43. ^ Cacti plugin. [2011-06-23]. (原始内容存档于2016-06-08). 
      44. ^ Robo 3T - formerly Robomongo — native MongoDB management tool (Admin UI). [2018-09-19]. (原始内容存档于2020-12-05). 
      45. ^ Fang of Mongo. [2011-06-23]. (原始内容存档于2020-09-12). 
      46. ^ Futon4Mongo. [2011-06-23]. (原始内容存档于2016-12-25). 
      47. ^ Mongo3. [2011-06-23]. (原始内容存档于2016-03-05). 
      48. ^ MongoHub. [2011-06-23]. (原始内容存档于2011-06-13). 
      49. ^ Opricot. [2011-06-23]. (原始内容存档于2011-06-18). 
      50. ^ Desimone, Joe. mongobleed. Github. 2025-12-31 [2025-12-31]. 
      51. ^ Kozlovski, Stanislav. MongoBleed explained simply. bigdata.2minutestreaming.com. [2025-12-31] (English). 
      52. ^ 52.0 52.1 Important MongoDB patch available. MongoDB Community Hub. 2025-12-24 [2025-12-31] (English). 
      53. ^ R6 Siege Breached: Infinite Credits, Bans & Do Not Login Warning. The CyberSec Guru. 2025-12-27 [2025-12-31]. 
      54. ^ 12 Months with MongoDB. 2010-10-25 [2011-05-24]. (原始内容存档于2020-11-09). 
      55. ^ MongoDB - diasporatest.com. 2010-12-23 [2010-12-23]. (原始内容存档于2010-11-24). 
      56. ^ Implementing MongoDB at Shutterfly - Presentation at MongoSF. 2010-04-30 [2010-06-28]. (原始内容存档于2011-05-18). 
      57. ^ MongoDB at foursquare - Presentation at MongoNYC. 2010-05-21 [2010-06-28]. (原始内容存档于2010-06-12). 
      58. ^ bit.ly user history, auto-sharded - Presentation at MongoNYC. 2010-05-21 [2010-06-28]. (原始内容存档于2010-06-11). 
      59. ^ Maher, Jacqueline. Building a Better Submission Form. NYTimes Open Blog. 2010-05-25 [2010-06-28]. (原始内容存档于2020-11-09). 
      60. ^ How Python, TurboGears, and MongoDB are Transforming SourceForge.net. PyCon 2010. 2010-02-20 [2010-06-28]. (原始内容存档于2011-02-11). 
      61. ^ How This Web Site Uses MongoDB. Business Insider. 2010-11-06 [2010-06-28]. (原始内容存档于2020-09-10). 
      62. ^ MongoDB at Etsy. Code as Craft: Etsy Developer Blog. 2010-05-19 [2010-06-28]. (原始内容存档于2011-06-14). 
      63. ^ Holy Large Hadron Collider, Batman!. The MongoDB NoSQL Database Blog. 2010-06-03 [2010-08-03]. (原始内容存档于2016-09-08). 
      64. ^ Building Our Own Tracking Engine With MongoDB. Thumbtack Blog. 2011-05-03 [2011-05-15]. (原始内容存档于2011-05-09). 
      65. ^ 楊惠芬. 趨勢科技導入MongoDB-追蹤管理全球10萬個行動裝置,上萬筆資料同時寫入. ithome. 2013-01-17 [2013-01-21]. (原始内容存档于2013-01-28). 

      外部連結[编辑]