MongoDB 简介(Introduction to MongoDB)

On this page

MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling.

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.


The advantages of using documents are:

  • Documents (i.e. objects) correspond to native data types in many programming languages.
  • Embedded documents and arrays reduce need for expensive joins.
  • Dynamic schema supports fluent polymorphism.

Key Features

High Performance

MongoDB provides high performance data persistence. In particular,

  • Support for embedded data models reduces I/O activity on database system.
  • Indexes support faster queries and can include keys from embedded documents and arrays.

Rich Query Language

MongoDB supports a rich query language to support read and write operations (CRUD) as well as:

High Availability

MongoDB’s replication facility, called replica set, provides:

  • automatic failover and
  • 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.
  • Starting in 3.4, MongoDB 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. See the Zones manual page for more information.

Support for Multiple Storage Engines

MongoDB supports multiple storage engines, such as:

In addition, MongoDB provides pluggable storage engine API that allows third parties to develop storage engines for MongoDB.

MongoDB 是一个开源的文档数据库,提供高性能、高可用性、自动缩放。

文档数据库 (Document Database)

在MongoDB中记录是一个文档,这是一个数据结构由字段和值对。MongoDB文档类似于JSON对象。字段的值可以包括其他文档、数组和文档数组。



使用文档的优点是:

  • 文档(即对象)与许多编程语言中的数据类型相一致。
  • 嵌入的文档和数组减少了昂贵连接的需要。
  • 动态模式支持流利多态性。

主要特点(Key Features)

高性能(High performance)

MongoDB提供高性能的数据持久性。特别的

  • 对嵌入式数据模型的支持降低了数据库系统的I/O活动。
  • 索引支持更快的查询,并且可以包含来自嵌入式文档和数组的键。

丰富的查询语言 (Rich Query Language)

MongoDB支持丰富的查询语言支持读写操作(CRUD)以及:

  • 数据聚集
  • 文本搜索和地理空间查询。

高可用 (High Availability)

MongoDB的复制工具,称为复制集,提供:

  • 自动故障转移
  • 数据冗余。
    副本集是一组MongoDB服务器保持相同的数据集,提供冗余,提高了数据的可用性。

横向扩展 (Horizontal Scalability)

MongoDB提供的水平可扩展性作为其核心功能的一部分:

  • 分片的数据分布在集群中的机器。
  • 从3.4开始,MongoDB支持创建基于碎片的关键数据区。在一个平衡的集群,MongoDB直接读取和写入的区域,只有那些碎片覆盖区内。

支持多个存储引擎 (Support for Multiple Storage Engines)

MongoDB支持多种存储引擎,如:

  • wiredtiger存储引擎
  • mmapv1存储引擎。

此外,MongoDB提供了可插拔的存储引擎API,允许第三方开发的MongoDB存储引擎。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 五月理应是万物生长一切生机盎然的时候,本该挺开心的,但是最近身边一个好友走了,才不得不把我拉回现实。 这是一个平常...
    曹大森阅读 376评论 0 0
  • url自定义,令牌token自定义 公众号支付,设置支付目录,设置回调在支付权限中 /* * 进行接口验证 */ ...
    琰哥阅读 424评论 0 0
  • 當大家都在推崇數位化,科技化的時候,為什麼Amy要推薦大家使用紙本的筆記本呢? 這不就是傳統跟現代科技的碰撞嗎? ...
    Amy愛咪阅读 224评论 0 3

友情链接更多精彩内容