翻译或纠错本页面

MongoDB简介

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

文档数据库

MongoDB中的一条记录就是一个文档,是一个数据结构,由字段和值对组成。MongoDB文档与JSON对象类似。字段的值有可能包括其它文档、数组以及文档数组。

A MongoDB document.

使用文档的优势在于:

  • Documents (i.e. objects) correspond to native data types in many programming languages.
  • 嵌入文档及数组减少了昂贵的joins操作的需求。

  • 动态的设计模式支持流畅的多态。

主要特征

高性能

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

  • 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.

丰富的查询语言

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

  • Data Aggregation
  • :query:` 文本检索 <$text>` 以及 :doc:` 地理空间查询 </tutorial/geospatial-tutorial>` 。

高可用性

MongoDB的复制设施,也叫作 :ref:` 复制集 <replication-introduction>` 提供了:

  • 自动的 故障恢复以及

  • 数据冗余。

A replica set is a group of MongoDB servers that maintain the same data set, providing redundancy and increasing data availability.

水平扩展能力

MongoDB provides horizontal scalability as part of its core functionality:

  • Sharding distributes data across a cluster of machines.
  • Tag aware 分片运行直接将数据引导到特定的分片,例如,考虑分片的地理分布等,

多个存储引擎的支持

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.